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

Change code example type #3619

Merged
merged 3 commits into from
Feb 5, 2025
Merged

Change code example type #3619

merged 3 commits into from
Feb 5, 2025

Conversation

rakuista
Copy link
Member

@rakuista rakuista commented Feb 4, 2025

The new docs site uses console instead of terminal to be compatible with Pygments.

The new docs site uses `console` instead of `terminal` to be compatible with Pygments.
@rakuista rakuista requested a review from doriable February 4, 2025 21:01
Copy link
Contributor

github-actions bot commented Feb 4, 2025

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedFeb 5, 2025, 8:20 PM

@@ -104,7 +104,7 @@ func generateMarkdownPage(
p("\n\n")
if command.Runnable() {
p("### Usage\n")
p("```terminal\n$ %s\n```\n\n", command.UseLine())
p("```console\n$ %s\n```\n\n", command.UseLine())
Copy link
Member

@stefanvanburen stefanvanburen Feb 4, 2025

Choose a reason for hiding this comment

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

We'll also want to update this in the processDescription function below, and make sure we update the function documentation.

For that function though, I did notice that while we're typically showing usage of buf in some console-esque context, we'll occasionally mis-classify some non-console text — e.g. on https://buf.build/docs/reference/cli/buf/generate/, the "template file" YAML is classified as terminal and would be changed to console (when it should really be yaml). I think it's ok to come back and fix that separately, if at all.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think it's fine to unify all to terminal. I'm not sure there is a better way to deal with different types of code blocks in descriptions unless the description itself passes the code block type. But yeah, definitely something to consider later.

Copy link
Member

Choose a reason for hiding this comment

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

s/terminal/console and I agree with you :)

}
if len(command.Long) > 0 {
p("### Description\n\n")
p("%s \n\n", processDescription(command.Long))
}
if len(command.Example) > 0 {
p("### Examples\n\n")
p("```\n%s\n```\n\n", processDescription(command.Example))
p("```console\n%s\n```\n\n", processDescription(command.Example))
Copy link
Member

Choose a reason for hiding this comment

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

This is fine to do, but I don't think we use command.Example — I was more referring in my comment to the function down on line 195; we'll want to update that from terminal -> console in the code and probably the comments above it. Happy to push a commit if you'd like me to!

Copy link
Member Author

rakuista commented Feb 5, 2025

Yep, realized that after committing this—working on it.

@rakuista rakuista merged commit b9fb0be into main Feb 5, 2025
10 checks passed
@rakuista rakuista deleted the refdoc-format branch February 5, 2025 20:32
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

Successfully merging this pull request may close these issues.

3 participants