mdcat
mdcat copied to clipboard
Feature Request: Themes/color control
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).
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.
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?
Sure it would!
Great.
Note to self: Use appropriate markdown scopes for elements in rendered output; see Markdown syntax definition for a list of possible scopes.
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 🤷♂️
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.
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:
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.