-
-
Notifications
You must be signed in to change notification settings - Fork 672
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
✨ Render Rich markup as HTML in Markdown docs #847
base: master
Are you sure you want to change the base?
Conversation
if rich is not None: | ||
# This is needed for when we want to export to HTML | ||
extra_str = rich.markup.escape(extra_str).strip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only bit that worries me a bit (here and L559) as this changes core functionality anytime get_help_record
is called on an argument or an option. Existing tests initially failed in test_doc.py
but I was able to remedy those by using highlight=False
, overflow="ignore"
and crop=False
in the rich_to_html
helper function.
Nevertheless @tiangolo, it would be good to get your eyes on this 🙏
Fixes #819: ensure that Rich-formatted help texts get rendered properly in Markdown by using the Rich built-in
export_html
functionality.I've expanded the example from #819 to ensure that the following are covered: Command help, Option help, Argument help, default value,
[required]
flag.TODO
Double check whether existing functionality and printing behaviour has remained unchanged.