doscify
的插件,控制台样式显示。
在index.html
中的head
与body
内分别添加以下内容
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/spite-triangle/docsify-terminal@latest/css/term.css"/>
<link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.css">
<script src="https://cdn.jsdelivr.net/gh/spite-triangle/docsify-terminal@latest/script/term.min.js"></script>
\`\`\`term
user@path$ command // annotation
\`\`\`
command output
user@path
与command
的分隔是靠"$ "
进行区分,$
之后还有一个空格,且在 command
中支持 \/
转义
var parts = lines[i].split('$ ');