Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Inconsistent use of single and triple backticks for codeblocks. #5

Closed
Schlomon opened this issue Jul 17, 2020 · 5 comments
Closed

Inconsistent use of single and triple backticks for codeblocks. #5

Schlomon opened this issue Jul 17, 2020 · 5 comments

Comments

@Schlomon
Copy link
Owner

Schlomon commented Jul 17, 2020

The use of ` and ``` is really inconsistent at the moment. We should determine some kind of convention.

So here is what I would suggest:

  1. Every path and shortcut gets surrounded by only one backtick.
  2. All commands for the command-line also get only one backtick but they're always in a new line.
  3. Everything else (e.g. actual code, files-structures, etc.) get the triple backticks. (Which automatically results in a new line)

Examples:

  1. Open the file dir1/dir2/file1, edit it and press Ctrl + S to save.

  2. To install dash execute:
    npm install --save-dev dash

  3. Import DashSDK with:

    import * as Dash from "dash";

I haven't found any "official conventions", so this is just a suggestion.

@riongull
Copy link
Contributor

Yeah, it's pretty inconsistent across the whole web to be honest, but I think it's uncontroversial to use single back ticks for inline files/directories/commands/etc and triple back ticks for code blocks.

Regarding your specific suggestions, I would lean more towards single line shell commands to be inline but let me go review the examples in this repo and think it over...

@Schlomon
Copy link
Owner Author

Schlomon commented Jul 18, 2020

I've put 1. and 3. only for completeness. 2. Is the only one we have to standardize.

@riongull
Copy link
Contributor

riongull commented Jul 20, 2020

I just read through the updated tutorial now that it's hosted and yeah, we definitely need to come up with a consistent method. The differences are very obvious on this Codeblock site because it formats code blocks with black background and inline code with gray. I personally prefer to see a code block only when there's a multiline block of code (Typescript) or code output, I think code blocks are overkill for both single-line shell instructions and single-line TS/JS code, which is why I refactored step 6 of the tutorial to be what it is now (with the import * as Dash from 'dash' no longer stand-alone as it is in your item 3 above). I guess we'd need others to chime in to break the tie on this.

@riongull
Copy link
Contributor

@cloudwheels, perhaps you could weigh in on this. It's not a big deal, but curious to hear your thoughts.

@Schlomon
Copy link
Owner Author

Schlomon commented Jul 30, 2020

Agreeing on @riongull's suggestion, implemented with commit 97cd569.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants