From 0804b68b89fec5a7d1859b231227a02915059986 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Thu, 11 Jan 2024 13:06:15 +0800 Subject: [PATCH] docs: prevent recursive caching - don't cache files in the cache directory --- docs/plugin/api.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/plugin/api.md b/docs/plugin/api.md index ec12fc86..b8caa90d 100644 --- a/docs/plugin/api.md +++ b/docs/plugin/api.md @@ -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`.