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

text_markup: Literal["rich", "markdown", "rst", None] config option #172

Open
dwreeves opened this issue Apr 8, 2024 · 1 comment
Open
Milestone

Comments

@dwreeves
Copy link
Collaborator

dwreeves commented Apr 8, 2024

  • Add text_markup: Literal["rich", "markdown", "rst", None].
  • Add optional rich-click[rst] support via the rich-rst package. https://github.com/wasi-master/rich-rst Very small package, but seems fine, so an optional dependency would work.
  • Silently deprecate/discourage use_markdown: bool and use_rich_markup: bool.
    • I don't not think it is worth warning.warn()ing users about this one. This is the sort of thing I'd deprecate only on release of a rich-click==2.0.0. It's just too trivial to support the bool args, and I would feel bad warning polluting users' warnings with this one.
    • However, I do think we should start to warn users via UserWarning when there are conflicts in in the config, since only one can be supported at a time.
      enabled_markup_options = sum(map(bool, [self.use_rich_markup, self.use_markdown, self.use_rst]))
      if enabled_markup_options > 1:
          import warnings
          warnings.warn(...)
      if enabled_markup_options == 1 and self.text_markup is not None:
          import warnings
          warnings.warn(...)
@dwreeves
Copy link
Collaborator Author

dwreeves commented Apr 9, 2024

Oh no, this can't go out for 1.8. The rich-rst library has some issues that make it not play nicely with what we're doing. I will have to reach out to the owner of this library separately and see what we can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant