NikitaIvanovV / ctpv

Image previews for lf file manager
https://www.nikitaivanov.com/man1/ctpv
MIT License
264 stars 24 forks source link

cannot preview readme files with glow #40

Closed harishnkr closed 1 year ago

harishnkr commented 1 year ago

Tried to use glow: for markdown previews. Does not work

config is as follows:

preview glow .md {{
    glow < "$f" 
}}

It works when invoked via command like without lf. Terminal : kitty

harishnkr commented 1 year ago

Never mind, I was able to view it after specifying the style (dark or light) I guess i can close the issue

NikitaIvanovV commented 1 year ago

Glad to know you figured it out! Do you think other people might consider this preview useful? If so, maybe we should add it as a built-in preview to ctpv?

harishnkr commented 1 year ago

Yes. I honestly think others would find it really beneficial. It works out of the box but there are some features missing in LF that fails to take advantage of text previews.

2023-03-11_10-00 2023-03-11_09-59

harishnkr commented 1 year ago

As you can see text wrapping is not functional (maybe i am overlooking some inbuilt features in LF). I used dark theme for the preview (which as i said before must be specified in order to use it). glow does not currently render images, but I am pretty sure it will work in the future.

But I cant currently view images from markdown files via mdcat either.

2023-03-11_10-10

I will add a pull request for glow as a previewer for ctpv if you are okay with it. I also hope LF make scroll preview a thing. If ctpv can make a feature for scrolling as well, it would be great.

NikitaIvanovV commented 1 year ago

Yes, feel free to open a pull request! You need to add a script to sh/prev/ and add a new entry to previews.h.