-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Docstring hyperlink #81
Comments
So I'm strongly considering adding some sort of formatting support for docstrings. Markdown would be one of those options, but RST is also a natural choice. Unfortunately, rich doesn't have native rst support. I think it would manifest itself in a way like:
|
Markdown looks gorgeous! Seems like most everything is working in the VSCode integrated terminal. Even code blocks with syntax highlighting and tables are working! I'm not seeing any new bugs introduced with this PR. |
do you think the API is fine? i.e. the field name being
|
Seems like a reasonable API to me. I would try to make it prominent in the docs. It's too nice of a feature for users to not know about it! |
follow up question: do we think "markdown" or "text" is a more reasonable default? The markdown looks much nicer. |
Good question. I agree that it likely improves the look of the average user's output. On the other hand, it is non-standard in the python world. I think markdown default still gets my vote. If a user doesn't intend to use it, it probably won't change their output. If it does, it probably looks better. On the off chance it messes up their formatting, they can always switch to "text". |
I'll investigate if I can reasonably add rst support. RST would be a good, python-sane default. If I cannot, I agree that I think setting "markdown" as the default is reasonable. |
Alright so, here's my thought process:
So, I think I'll do the following:
@Gracecr what do you think of this plan? |
Sounds like a solid plan! Looks like RST also won't mess with plaintext, so users who don't intend to use any special formatting shouldn't even notice that their help text is being rendered as RST. The aliases are also a good idea. I'm more of a markdown guy myself, but I can take a look if any issues pop up with |
this is now in v2.2.0, thanks! |
I'd like to include a hyperlink in my
long_description
. If I include a link, my TE allows me to CTRL+click it, which is great, but I'd rather not have the full link print if I can avoid it. I see that some TEs have support for hyperlinks, and it seems like rich supports this (bottom of section). Is there a way I can achieve this withcyclopts
?My hunch is "not currently" as I see that
long_description
is added as a single Text component with the style "info". It'd be cool if it could be parsed as markdown, but I understand why that'd be a bad default.Also, really nice library. I've used click in the past. I was going to try typer, but I saw this project mentioned in an issue about Unions. Very impressed.
The text was updated successfully, but these errors were encountered: