Skip to content

Commit

Permalink
docs: prevent recursive caching - don't cache files in the cache dire…
Browse files Browse the repository at this point in the history
…ctory
  • Loading branch information
sxyazi committed Jan 11, 2024
1 parent a986477 commit 0804b68
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/plugin/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,14 @@ TODO

## ya

### `cache_file(path)`
### `file_cache(opts)`

Calculate the cached [Url](#url) corresponding to the given path:
Calculate the cached [Url](#url) corresponding to the given file:

- `path` - Required, the path of the file, which is a string
- `opts` - Required, the options of the cache, which is a table:

- `file` - The [File](#file) to be cached
- `skip` - The number of units to skip. It's units largely depend on your previewer, such as lines for code, and percentages for videos

If the file is not allowed to be cached, such as it's ignored in the user config, or the file itself is a cache, returns `nil`.

Expand Down

0 comments on commit 0804b68

Please sign in to comment.