安装npm
1 2 3 4 5 6 7 8 9 10 |
# !-bash # 安装依赖 sudo apt-get install nodejs-dev node-gyp libssl1.0-dev # 将node.js加入安装源 curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - # 安装node.js和npm sudo apt-get install -y nodejs |
安装docsify
1 2 3 |
# !-bash sudo npm i docsify-cli -g |
初始化
1 2 3 |
# !-bash docsify init ./docs |
加入侧边栏
修改index.html
1 2 3 4 5 6 7 8 9 10 11 12 |
<script> window.$docsify = { loadSidebar: true, subMaxLevel: 2, name: '', repo: '' } </script> <script src="//unpkg.com/docsify/lib/docsify.min.js"></script> <script src="//unpkg.com/prismjs/components/prism-python.js"></script> <!- 语法高亮插件 -> <script src="//unpkg.com/prismjs/components/prism-yaml.js"></script> |
新建_sidebar.md
1 2 3 4 5 6 7 8 9 10 |
**[主页](/)** - 一级标题1 - [二级标题1](usage.md) - 一级标题2 - [二级标题2](interface.md) - 一级标题3 - [二级标题3](attachment.md) |
预览网页
1 2 3 |
# !-bash docsify serve docs -p 8000 |