top | item 42579987

(no title)

jackpirate | 1 year ago

> I've seen a lot of examples that use CSS to show the prompt or line number without it becoming part of copied text, and I'm highly in favor of that.

This is unfortunately not compatible with writing the tutorial in markdown to be rendered on github.

discuss

order

xmprt|1 year ago

I'm not sure about that. There are markdown rendering engines where you can specify the language of a codeblock and it will render with specific CSS based on the language. So you can do something like ```bash ... ``` and it will show the code with newlines prefixed by "$"

yencabulator|1 year ago

That's only for highlighting.

```bash assumes content is a valid shell script

```console assumes content is a dialog between a user and a computer, with $ or such prompts and unprefixed program output

Console sessions showing output is why you can't magically auto-prefix every line with a prompt.

grodriguez100|1 year ago

AFAIK specifying a language only makes a difference for syntax highlighting. I have never seen a markdown processor that would add prompts to the code based on the specified language.