Skip to content

Commit

Permalink
docs: add preset preloaders and previewers
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Jan 14, 2024
1 parent ad906d4 commit d8e339c
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions docs/configuration/yazi.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,32 @@ Available rule parameters are as follows:

## [plugin]

### Previewer
### previewers

You can prepend or append new preview rules to the default `previewers` under `[plugin]` using `prepend_previewers` and `append_previewers`.
You can prepend or append new preview rules to the default `previewers` under `[plugin]` by `prepend_previewers` and `append_previewers`.
Here are the available options for a single rule:

- `name` (String): Glob expression for matching the file name. Case insensitive by default, add `\s` to the beginning to make it sensitive.
- `mime` (String): Glob expression for matching the mime-type. Case insensitive by default, add `\s` to the beginning to make it sensitive.
- `exec` (String): The name of the Lua plugin to be executed
- `sync` (Boolean): Whether to execute synchronously, the default is `false`

### Preloader
Yazi comes with the those previewer plugins:

You can prepend or append new preview rules to the default `preloaders` under `[plugin]` using `prepend_preloaders` and `append_preloaders`.
- folder: bridge between the Yazi file system and the preview
- code: bridge between built-in code highlighting and the preview, providing async concurrent rendering
- json: bridge between `jq` and the preview, providing async concurrent rendering
- noop: no operation
- image: presentation layer of built-in image preview, offering mixed preview capabilities
- video: bridge between `ffmpegthumbnailer` and the preview, offering mixed preview capabilities
- pdf: bridge between `pdftoppm` and the preview, offering mixed preview capabilities
- archive: bridge between `unar` and the preview, offering mixed preview and concurrent rendering capabilities

If you want to create your own preloader, see [Previewer API](../plugins/overview.md#previewer).

### preloaders

You can prepend or append new preview rules to the default `preloaders` under `[plugin]` by `prepend_preloaders` and `append_preloaders`.
Here are the available options for a single rule:

- `name` (String): Glob expression for matching the file name. Case insensitive by default, add `\s` to the beginning to make it sensitive.
Expand All @@ -167,6 +180,16 @@ Here are the available options for a single rule:
- `multi` (Boolean): Whether to preload multiple files at once
- `prio` (String): Preload priority, `low`, `normal` or `high`. The default is `normal` if not specified.

Yazi comes with the those preloader plugins:

- mime: preloads mime-type of files in chunks
- noop: no operation
- image: preloads and caches images
- video: preloads and caches videos
- pdf: preloads and caches PDFs.

If you want to create your own preloader, see [Preloader API](../plugins/overview.md#preloader).

## [input]

You can customize the title and position of each `Input`. As for position, it consists of two parts: [Origin](#origin) and [Offset](#offset).
Expand Down

0 comments on commit d8e339c

Please sign in to comment.