在Markdown文件中突出显示Bash/shell代码 [英] Highlight Bash/shell code in Markdown files

查看:125
本文介绍了在Markdown文件中突出显示Bash/shell代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

For example, to highlight js, I write:

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

要突出显示HTML代码,我使用```html .

To highlight HTML code I use ```html.

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

How can we highlight Bash/shell commands?

推荐答案

这取决于Markdown渲染引擎和Markdown风格.这没有标准.如果您以GitHub风格的Markdown为例,则 shell 应该可以正常工作.别名是 sh bash zsh .您可以在此处找到可用的语法词法列表.

It depends on the Markdown rendering engine and the Markdown flavour. There is no standard for this. If you mean GitHub flavoured Markdown for example, shell should work fine. Aliases are sh, bash or zsh. You can find the list of available syntax lexers here.

这篇关于在Markdown文件中突出显示Bash/shell代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆