Skip to content

Markup shell session snippets as console - #1514

Merged
cert-manager-prow[bot] merged 1 commit into
cert-manager:masterfrom
lindhe:patch-2
Jul 18, 2024
Merged

cert-manager-prow[bot] merged 1 commit into
cert-manager:masterfrom
lindhe:patch-2

Conversation

@lindhe

@lindhe lindhe commented Jul 10, 2024 •

Copy link
Copy Markdown
Contributor

This change replaces "bash" with "console" as the Markdown code fence keyword. This lets Markdown engines differentiate between the shell command and its output, with a leading $ (or # or >) denoting a command and the rest is just text output with no syntax highlighting.

This change replaces "bash" with "console" as the Markdown code fence keyword. This lets Markdown engines differentiate between the shell command and its output, with a leading $ (or # or >) denoting a command and the rest is just text output with no syntax highlighting.

Signed-off-by: Andreas Lindhé <[email protected]>
@cert-manager-prow cert-manager-prow Bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 10, 2024
@lindhe

lindhe commented Jul 10, 2024 •

Copy link
Copy Markdown
Contributor Author

As documented here, GitHub uses linguist to render syntax highlighting. And linguist has support for the console keyword to signify shell sessions. I do not know if the cert-manager website supports the same syntax highlighting as GitHub, but I think this is an improvement regardless of that.

The reason this is an improvement even if the website does not support the console keyword (which it might) is that I expect the website to render this as plain text if it does not recognize the code fencing keyword. That would be better than rendering this console output as Bash code. Also, it will look good on GitHub regardless of what it looks like on the website.

Here's what it looks like on the website today:

image

image

Notice how random integers get highlighted, and whatnot.

@netlify

netlify Bot commented Jul 10, 2024

Copy link
Copy Markdown

✅ Deploy Preview for cert-manager ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 94725cf
🔍 Latest deploy log https://app.netlify.com/sites/cert-manager/deploys/668e3d2e94e93800089a9c44
😎 Deploy Preview https://deploy-preview-1514--cert-manager.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@lindhe

lindhe commented Jul 10, 2024

Copy link
Copy Markdown
Contributor Author

Seems like the website will render this without any syntax highlighting (based on the preview build):

image

Yet, as I mentioned, I think this is an improvement over having incorrect syntax highlighting.

@inteon

inteon commented Jul 15, 2024

Copy link
Copy Markdown
Member

@wallrj wallrj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @lindhe

I agree that console is more appropriate than bash for snippets that show the command and the output.

It's a shame there's no syntax highlighting in for console, but better than highlighting weirdly.

/approve
/lgtm

@cert-manager-prow cert-manager-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 18, 2024
@cert-manager-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wallrj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow cert-manager-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 18, 2024
@cert-manager-prow
cert-manager-prow Bot merged commit 737bb54 into cert-manager:master Jul 18, 2024
@lindhe
lindhe deleted the patch-2 branch July 18, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants