Closed Canop closed 3 months ago
BTW, I'd welcome suggestion of transformers for the website (and my own usage)
both verified iterm/macos in principle, pdf image a little blurry but perhaps that is outside broot's hands?
excited to see what else can be done with this feature! ( :
@eddiehazel The image is blurry here because your terminal doesn't support the Kitty protocol which broot uses to display high-res images.
thanks, looking into it!
# Use fold to wrap text
# In this example, the command refers to neither the input nor the output,
# so broot pipes them to the stdin and stdout of the jq process
{
input_extensions: [ "txt" ]
output_extension: txt
mode: text
command: [ "fold", "-w 80", "-s" ]
}
]
working well 💫
IMO wrapping should be done by broot so that the line numbers stay consistent (usually you want to jump to the right place when opening the file), but that's an interesting first step before I implement wrapping in broot.
for sure, just playing around and it works for now ( :
so i need to switch terminal to get kitty support because everyone has their own protocol ðŸ˜
i thought to make a transformer for this with timg
but i guess it's lower level
i will take a look at some alternatives
so i need to switch terminal to get kitty support because everyone has their own protocol ðŸ˜
i thought to make a transformer for this with timg but i guess it's lower level
This can't really be a transformer. The protocol of iterm2 could probably be implemented in broot the same way I implemented the kitty protocol but I can't do it myself as I don't own a Mac.
seems there is a lot of inspiration here: https://github.com/lusingander/iterm2img
not sure if it's quite within my wheelhouse but i'll try size it up - wdyt?
definitely up for testing either way! 🤲
btw https://wezfurlong.org/wezterm/imgcat.html seems xplatform + iterm img protocol and it's rust 🦀 👀
not sure if it's quite within my wheelhouse but i'll try size it up
Even if you don't manage to finish, clarifying the problems and possible solutions would both be enlightening and useful, so you probably should. And you can come to miaou to discuss your findings.
But we're going off the topic of this PR, so I suggest you create an issue for item2 support in broot (or for high-res image support on mac if you prefer it less specific).
I personally don't particularly care about this feature but gave it a try on a mac anyways, @Canop I hope this helps.
name | version |
---|---|
nu | 0.95.0 |
wezterm | 20240203-110809-5046fc22 |
os | macos |
Not sure if this is an issue of broot or any other part of my setup but pdfs and images for whatever reason don't fully utilize the space available for the preview panel. pdf
pdfs and images for whatever reason don't fully utilize the space available for the preview panel.
All images ? Or just the ones coming from pdf transformation ?
Nevermind, I think the images I downloaded where just simply too small.
The issue seems to be related to the pdf image transformation, maybe one needs to do something with mutool
You can increase the image width:
{
input_extensions: [ "pdf" ] // case doesn't matter
output_extension: png
mode: image
command: [ "mutool", "draw", "-w", "1000", "-o", "{output-path}", "{input-path}" ]
}
I could probably define some {preview-width}
parameter...
But this is one of those things which aren't always determined so I'm not sure it would be good.
This allows defining file transformations that are applied to files before preview.
The default conf has 2 examples: previewing PDF and beautifying JSON:
PDF preview:
JSON beautification (the original file has no space nor new line):
Fix #494