bash - 如何在 Markdown 中突出显示 bash/shell 命令?

标签 bash shell markdown github-flavored-markdown

如何在 Markdown 文件中突出显示 Bash/shell 命令?


例如,为了突出js,我写:

```js
function () { return "This code is highlighted as Javascript!"}
```

为了突出显示 HTML 代码,我使用 ```html

我们如何突出显示 Bash/shell 命令?

最佳答案

如果您希望在用户看来突出显示 shell session 命令序列(带有提示,而不仅仅是假设脚本文件的内容),那么此时使用的正确标识符是 console:

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

GitHub Markdown preview tab screenshot

关于bash - 如何在 Markdown 中突出显示 bash/shell 命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20303826/

相关文章:

linux - 如何使用脚本编辑只读文件?

markdown - 有没有办法在 Markdown 中格式化对话?

http-status-code-404 - 使用自定义域时,Github 页面相关链接不起作用

c# - Markdown 清晰地将我的 html 字符串包装在 "p"元素中?

linux vm 登录使用 Shell 脚本

bash - awk 扫描单引号字符的字符串

linux - 如何删除具有匹配模式的整行仅存在于列范围 75 到 104 中

linux - Ansible 返回码错误 : 'dict object' has no attribute 'rc'

linux - 如果文件中存在,awk 管道的尾部不追加

bash - 将所有 tar.bz2 文件解压到一个目录