Skip to content
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

Disable markup by default #151

Open
hamdanal opened this issue Feb 1, 2025 · 0 comments
Open

Disable markup by default #151

hamdanal opened this issue Feb 1, 2025 · 0 comments
Labels
argparse Concerns argparse rich Concerns rich

Comments

@hamdanal
Copy link
Owner

hamdanal commented Feb 1, 2025

This issue is to collect feedback before making the change.

I am thinking about making rich markup opt-in instead of opt-out. This of course would require a major version bump so I am thinking of making it part of the 2.0 release.

There has been at least one person asking for markup to be disabled by default #120 (comment). I find the arguments presented in that discussion convincing but couldn't change the default at the time as it would be a breaking change.

Long term, it would be a better user experience if rich-argparse behavior matches exactly that of argparse (except for the colors). This is especially useful for these two scenarios:

  1. Large projects that adopt rich-argparse where it would be easy to miss a few square brackets in the help strings
  2. Projects that would offer optional rich-argparse support and fallback to standard argparse if rich-argparse is not installed

I am not sure if there should be a warning at runtime and how annoying it would be for users. It might be possible to detect the use of markup syntax and only issue a warning if markup is used while not explicitly activated.
As a reminder, RichHelpFormatter.help_markup = True would activate markup for help strings and RichHelpFormatter.text_markup = True would activate markup for descriptions/epilog.

@hamdanal hamdanal added argparse Concerns argparse rich Concerns rich labels Feb 1, 2025
@hamdanal hamdanal pinned this issue Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
argparse Concerns argparse rich Concerns rich
Projects
None yet
Development

No branches or pull requests

1 participant