mdcat icon indicating copy to clipboard operation
mdcat copied to clipboard

Feature Request: Themes/color control

Open rien333 opened this issue 5 years ago • 5 comments

Any way to change the color output? By default, my html comments are green, which for longer comments makes them quite hard to read in my theme (which might be partly due to my theme being at fault; nonetheless, being able to change it from green could improve readability under some circumstances)

Themes would be a more general solution, but an option that allows for more fine-grained control of colors could also be handy.

As a slight bonus, it would be neat if themeing would allow you to se text properties (e.g. disabling bold headers, making comments italic but the same color as regular text, etc).

rien333 avatar Dec 20 '18 21:12 rien333

There’s no such feature, and I for my part won’t add it myself; I just don’t need it.

I’m open for pull requests though.

swsnr avatar Dec 21 '18 08:12 swsnr

I think I’ll make mdcat use syntect themes for colouring and styling and add means to change the theme via env vars, like bat does it. This would also simplify code a bit.

Would this work for you?

swsnr avatar Dec 27 '18 11:12 swsnr

Sure it would!

rien333 avatar Dec 27 '18 15:12 rien333

Great.

Note to self: Use appropriate markdown scopes for elements in rendered output; see Markdown syntax definition for a list of possible scopes.

swsnr avatar Dec 29 '18 11:12 swsnr

We’ll also at some point want to check COLORTERM for 24bit support and use ansi_colours to convert to 256 bit colours if the terminal doesn’t support true colours.

Or we’ll just dump 24bit escape codes and hope that the terminal emulator copes, in whatever way 🤷‍♂️

swsnr avatar Jan 07 '19 08:01 swsnr

Closing this, because I don't intend to do anything about this any time soon. Some basic infrastructure exists, but as things stand I'm happy with the default colours, and won't change anything here.

Pull requests are welcome.

swsnr avatar Oct 18 '23 18:10 swsnr

I would also majorly support this feature (but can't contribute code as I don't know rust - yet! 😅 ). With 2k stars to date I'm honestly suprised this hasn't been requested more often.

For example, I use iTerm2 with a pretty standard dark mode theme, and TOC links are nearly unreadable in all but the darkest rooms:

image

If not a full suite of different themes like bat, perhaps it would be more tractable to implement just two, one optimized for light more and one for dark mode?

This one niggle aside, major love for mdcat! Definitely the best command line Markdown viewer around.

cohml avatar Feb 05 '24 20:02 cohml