When showing shell commands in a #markdown file, which language are using for the fenced block?
```shell
$ foo --bar --baz
```
Everyone seems to be doing something different and I'm curious what's the "right" way. I'm also wondering why markdownlint hates such blocks (with a $), if they don't produce any output. That seems a bit arbitrary to me.
@bbatsov I have two hot takes here:
"shell" isn't a language. If it's a bash script, use "bash" so I know not to paste it into my fish shell.
Lose the dollar sign. This is a code block, and the dollar sign isn't part of the code. Especially relevant for code I'm likely to be pasting into my terminal. Also likely to confuse learners who are unaware of what it's supposed to represent.
@bodil Fair points, but there's also the counter-argument that the $ makes it obvious that something is a command one needs to enter in some shell. (if they are familiar with shells) I'm guessing that why so many people put them in their snippets.
@bbatsov I think so many people put them in their snippets just because they see others doing it, tbh.
@weavejester @bodil I’m pretty sure that “console” is the way to go when there’s actual output.
@bbatsov I agree with markdownlint here. And that language should be set to ${SHELL##*/}.
@bbatsov I'm usually using "sh" or "bash"