visit1985 / mdp

A command-line based markdown presentation tool.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request: Configurable colour schemes and de-theme

ersi-dnd opened this issue · comments

Somewhat related to #51

It seems to me that mdp has some minor theming out of the box, instead of relying entirely on the configuration of the terminal emulator. If there already is a colour theme inbuilt, I suggest it would be nice to have more than one theme, and it would be even nicer to have a themeless mode, inheriting everything from ~/.Xresources or the like.

For me as a first step it is more important to be able to strip mdp of any colouring it may have on its own and let it inherit the terminal colours, instead of being able to add more themes specifically for mdp.

Or are themes already configurable and documented somewhere?

I took the time to read some of the code of this wonderful little programme. I never learned programming, so correct me if I am wrong, but it seems to me that displayable colours are hardcoded in the viewer.c file.

The hardcoding causes conflicts in my terminal emulator. My terminal emulator is Xterm with black background. In it, I launched mdp inverted

mdp -i sample.md

and got only black slides. It's as if mdp assumes that the background is transparent or light and thus it is sufficient to invert just the text, not the background.

The following produced appropriate result:

mdp -ti sample.md

I strongly believe that the much more appropriate way to go about colouring is to inherit the colours from the terminal emulator and not assume them. To devise more themes would be a secondary nice to have feature.

mdp doesn't know anything about terminal emulators. It just uses vt100 escape sequences. It is up to your terminal emulator to interpret them correctly.

Yes, -t and -i can help to fix some wrong behaviour.