Skip to content

test: parameter description contains Markdown #94

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

Merged
merged 3 commits into from
Feb 7, 2023

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Feb 7, 2023

Related: coder/coder#5931

This PR improves tests to present that the Markdown format is acceptable for the parameter description.

This PR introduces a new Markdown property to render rich descriptions, with Markdown tags included (see example).

Comment:
I admit that I wanted to use the description and then strip Markdown tags from descriptions in CLI, but when I looked at the logic required to perform this (rewritten to Go), I decided to KISS and use a dedicated property, that is only processed by the site.

@mtojek mtojek self-assigned this Feb 7, 2023
@mtojek mtojek requested review from kylecarbs and mafredri February 7, 2023 13:38
@mtojek mtojek marked this pull request as ready for review February 7, 2023 13:38
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@kylecarbs kylecarbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm leaning towards optimizing syntax for the web interface rather than the CLI, because it's presently unclear in the syntax when description would be shown and when description_markdown would be.

What do you think about making description markdown by default, then add a description_plaintext for the CLI? Another option is to display the markdown as text in the CLI, which I don't think is bad. Markdown is pretty readable anyways (I think this might be my preference actually).

@mtojek
Copy link
Member Author

mtojek commented Feb 7, 2023

Thanks for jumping in, @kylecarbs.

I'm leaning towards optimizing syntax for the web interface rather than the CLI, because it's presently unclear in the syntax when description would be shown and when description_markdown would be.

TIL! I think that we have to highlight who is the more important consumer, CLI or site. We can use it as the rule of thumb that in our case it's always the site.

What do you think about making description markdown by default, then add a description_plaintext for the CLI?

If we're site-oriented, then description should be kept as is, even if it uses Markdown tags. Additionally, we can expose an extra generated field in the API that shows the rendered description, description_plaintext. I don't think that this is something we need to keep in the database, it can be rendered dynamically 👍 .

Let me know your thoughts.

@kylecarbs
Copy link
Member

That makes sense to me. I like it!

@mtojek mtojek closed this Feb 7, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Feb 7, 2023
@mtojek mtojek reopened this Feb 7, 2023
@mtojek
Copy link
Member Author

mtojek commented Feb 7, 2023

Maybe I will update examples to show that Markdown description is fine.

@mtojek mtojek changed the title feat: Add description_markdown property to rich parameter test: parameter description contains Markdown Feb 7, 2023
@mtojek mtojek requested a review from mafredri February 7, 2023 14:41
@mtojek mtojek merged commit 66d82c9 into coder:main Feb 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants