tldr-pages / tldr-python-client

:snake: Python command-line client for tldr pages 📚
https://pypi.org/project/tldr/
MIT License
599 stars 95 forks source link

Feature request: more color setup #179

Open EmilyGraceSeville7cf opened 2 years ago

EmilyGraceSeville7cf commented 2 years ago

I suggest split TLDR_COLOR_COMMAND into the two variables:

Variable Meaning
TLDR_COLOR_COMMAND Color for only the first token in the code example
TLDR_COLOR_OPTION Color for only the long/old/short options and flags

and add envs to control braces and pipe symbol colors:

Variable Meaning
TLDR_COLOR_BRACE Color for the opening/closing braces
TLDR_COLOR_PIPE Color for only the pipe symbol

Maybe I can try to create PR for this issue. ;)

MasterOdin commented 2 years ago

Getting to be quite a lot of environment variables, and time to have a configuration file instead, especially on adding more specific theming stuff.

Might be good to look at interop with the tldr-node-client and move to having a .tldrrc file that you can use to configure settings, and follow what they have there for color options: https://github.com/tldr-pages/tldr-node-client#configuration

Could then add the brace and pipe on top of that, with a suggestion to add it there.

EmilyGraceSeville7cf commented 2 years ago

Well, as I understood we have to use environment variables for basic customization and .tldrrc for advanced one. Right? What has more priority: environment variables or .tldrrc?

MasterOdin commented 2 years ago

Eh, for now, I'm fine with you just implementing these as new environment variables. I'll make a separate issue to track implementing .tldrrc.

What has more priority: environment variables or .tldrrc?

environment variables should have top priority, so that it allows doing TLDR_LANGUAGE=es in a given terminal session and just use that, without overwriting the default permanently.