-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Highlights options, choices and metavars #95
Comments
Thank you! Glad you like it!
A more fine-grained theming (metavars and defaults) was something I tried to implement when I first introduced the theming feature! Unfortunately, click is not very well designed when it comes to formatting. Formatting logic is splitted in many components and the so called Coming to you proposal, I'm all in for adding the feature, of course, but using regular expressions looks more like a workaround to me :( |
Aha, great minds think alike! I guess we both reached the conclusion that finer highlighting increase the readability of help screens. I just had a look at your bug reports and PRs to Click project. And realized how much work it takes to already have that flexible help in Cloup. Thanks a lot for your dedication and thanks for making Click better! Now for that extra-highlighting. I understand you do not want to taint Cloup's clean code with ugly regexps. 😉 My rationale was that help screen are not consumed by machine but are designed for human. So a hack was good enough and a good compromise. Ideally we should have proper fine-grained support of semantics in Click. I guess this is more or less covered by that mega-issue: pallets/click#561 Anyway, feel free to close this issue if it doesn't make sense. I think I'll still try to piggy-back on Cloup in my CLIs and re-adapt my regexps to its logic (depending on my motivation). |
;)
Thank you, I appreciate it! It was a lot of work indeed.
It's totally okay to do that at the application level but it's still a workaround. I've made use of workarounds in Cloup but in this case "there must be a better way" (quote). Furthermore, I was thinking that maybe rather than improving the console help page, it's better to invest time in generating HTML documentation / man pages and opening the browser when the user runs
I'll close this issue and open a new one that references this one, since I'm open to include the feature. Unfortunately I've no time for this right now :(. |
FYI, I just release |
I just discovered
cloup
and it is fantastic! It's basically an up-to-date bundle of all the unmaintainedclick-contrib
utilities! 😍I developed some code in my
mail-deduplicate
CLI some month ago to automatically highlights all options, choices and metavars in help screens generated by click. See how it renders:For reference, here is my current implementation: https://github.com/kdeldycke/mail-deduplicate/blob/develop/mail_deduplicate/colorize.py
@janluke, would you be interested by my attempt at integrating my extra-highlight logic into
cloup
's help formatting code?The text was updated successfully, but these errors were encountered: