-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Custom Preview Commands #182
Comments
Very similar to what I had in mind. The file preview will be integrated into Yazi's plugin system, with Yazi itself retaining only two basic types (ASCII escape codes and images). I had begun to experiment with it, and the theme system is its first step. I am currently building the necessary underlying abstractions around it. |
I would like this feature as well! Thanks for bringing that up. |
Done by #401. Here are some examples of built-in plugins: https://github.com/sxyazi/yazi/tree/main/yazi-plugin/preset/plugins You can try them out on the latest main branch. I'll soon release API documentation for the preloader and previewer at https://yazi-rs.github.io/ |
I'm going to lock this issue because it has been closed for 30 days. ⏳ This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Custom Preview Commands
In the preview pane I would like to specify a custom command to output for each file type, possibly overriding the built-in providers. This could be implemented similar to the
[open]
and[opener]
config sections inyazi.toml
such as[preview].rules
and[previewer]
.User configurable previewers should allow any possible preview output, especially text, and would remove the burden of needing to add every edge-case previewer provider to the
yazi
source.Handling of external commands that output text could be handled like
jq
is currently. Though some programs might be blocking and have to finish before they output any lines.External preview commands for images could either be direct to stdout or need to be written to a cache file first and then the standard image preview behavior could be used. An environment variable such as
$IMAGE_CACHE_PATH
could be passed to the external command's shell to be used as an argument.Example Use Cases
mediainfo
orexiftool
textual/informational previews.pdftotext
..epub
or.docx
to markdown and then text preview with syntax highlighting..epub
,.doc
,.docx
previewer either as image preview or converted withpandoc
to markdownxls2csv
Related Features
Ability to keybind a menu selection of different
[previewer]
for the selected file type just like theopen --interactive
menu foropen
keybinds.Having a way to globally toggle between image previewers and text previewers.
The text was updated successfully, but these errors were encountered: