-
Notifications
You must be signed in to change notification settings - Fork 886
feat: render Markdown in rich parameter descriptions #6098
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
Conversation
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.
That markdown lib was an nice find! My main concern is the lossiness of the plaintext output, otherwise this looks good. 👍🏻
coderd/parameter/plaintext_test.go
Outdated
|
||
` + "`There are also code tags!`" | ||
|
||
expected := "Provide the machine image See the registry for options. Minion This is bold text. This is bold text. This is italic text. Blockquotes can also be nested. Strikethrough. 1. Lorem ipsum dolor sit amet. 2. Consectetur adipiscing elit. 3. Integer molestie lorem at massa. There are also code tags!" |
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.
Do we actually want the CLI output to be this lossy? For instance:
- Why do we not keep newlines?
- Why don't we print links? We could e.g. do something like:
See the registry (https://container.registry.blah/namespace) for options
.
If newlines are not wanted here, perhaps we could call the field DescriptionCondensed
instead of plaintext?
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.
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.
Lovely!
Fixes: #5931
This PR introduces an option to use Markdown tags in rich parameter descriptions.
CLI will switch to
description_plaintext
to skip all tags. It uses glow to render the Markdown content as ASCII text.CLI:

Site:

Template: