Skip to content

Commit

Permalink
docs: add mime.yazi to resources and remove mime_valid from utils
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Feb 19, 2024
1 parent f82b343 commit fecd9bb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
20 changes: 10 additions & 10 deletions docs/plugins/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ You can extend Yazi's functionality through Lua plugins, which need to be placed
~/.config/yazi/
├── init.lua
├── plugins/
│   ├── fzf.yazi/
│   └── zoxide.yazi/
│   ├── foo.yazi/
│   └── bar.yazi/
└── yazi.toml
```

Each plugin is a directory ending with `.yazi`, containing an `init.lua` file for the plugin's initialization.
For instance, the structure of the `zoxide` plugin is as:
For instance, the structure of the `bar` plugin is as:

```
zoxide.yazi/
bar.yazi/
└── init.lua
```

Expand Down Expand Up @@ -67,18 +67,18 @@ The plugin system is designed with an async-first philosophy. Therefore, unless
There is one exception - all `init.lua` are synchronous, which includes:

- The `init.lua` for Yazi itself, i.e. `~/.config/yazi/init.lua`.
- The `init.lua` for each plugin, e.g. `~/.config/yazi/plugins/zoxide.yazi/init.lua`.
- The `init.lua` for each plugin, e.g. `~/.config/yazi/plugins/bar.yazi/init.lua`.

This is because `init.lua` is commonly used to initialize plugin configurations, and this process is synchronous:

```lua
-- ~/.config/yazi/init.lua

-- Initialize the zoxide plugin
-- Which needs `~/.config/yazi/plugins/zoxide.yazi/init.lua` to export a `setup` function
require("zoxide").setup {
foo = "hello",
bar = "world",
-- Initialize the bar plugin
-- Which needs `~/.config/yazi/plugins/bar.yazi/init.lua` to export a `setup` function
require("bar").setup {
key1 = "hello",
key2 = "world",
-- ...
}
```
Expand Down
6 changes: 0 additions & 6 deletions docs/plugins/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,6 @@ Truncate the text to the specified length and return it:
- `text` - Required, the text to be truncated, which is a string
- `max` - Required, the maximum length of the text, which is an integer

### `mime_valid(mime)`

Check whether the mime-type is valid:

- `mime` - Required, the mime-type to be checked, which is a string

### `time()`

Returns the current timestamp, which is a float, the integer part represents the seconds, and the decimal part represents the milliseconds.
Expand Down
10 changes: 7 additions & 3 deletions docs/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@ Markdown:

CSV:

- [miller.yazi](https://github.com/Reledia/miller.yazi) - Preview csv files (and other supported formats) using [miller](https://github.com/johnkerl/miller)
- [miller.yazi](https://github.com/Reledia/miller.yazi) - Preview CSV files (and other supported formats) using [miller](https://github.com/johnkerl/miller)

Binary:

- [hexyl.yazi](https://github.com/Reledia/hexyl.yazi) - Preview every file by showing its hex value using [hexyl](https://github.com/sharkdp/hexyl)
- [hexyl.yazi](https://github.com/Reledia/hexyl.yazi) - Using [hexyl](https://github.com/sharkdp/hexyl) as the fallback previewer for files

Audio:

- [exifaudio.yazi](https://github.com/Sonico98/exifaudio.yazi) - Preview audio metadata using [exiftool](https://exiftool.org/)
- [exifaudio.yazi](https://github.com/Sonico98/exifaudio.yazi) - Preview audio metadata and cover using [exiftool](https://exiftool.org/)

## Preloaders

- [mime.yazi](https://github.com/DreamMaoMao/mime.yazi) - Replace the builtin `mime` plugin to speed up the identification of large files by using file extensions instead of file content to obtain the mime-types.

## Functional plugins

Expand Down

0 comments on commit fecd9bb

Please sign in to comment.