Highlight Bash/shell code in Markdown files

后端 未结 7 1972
猫巷女王i
猫巷女王i 2021-01-29 17:35

How can I highlight the Bash/shell commands in Markdown files?


For example, to highlight js, I write:



        
7条回答
  •  伪装坚强ぢ
    2021-01-29 18:05

    If you are looking to highlight a shell session command sequence as it looks to the user (with prompts, not just as contents of a hypothetical script file), then the right identifier to use at the moment is console:

    ```console
    foo@bar:~$ whoami
    foo
    ```
    

提交回复
热议问题