VuePress
- 参考:
- 插件:https://vuepress.github.io/zh (opens new window)
- 支持语言:https://prismjs.com/#languages-list (opens new window)
安装
# 安装
npm install -g vuepress
# 卸载
npm uninstall -g vuepress
1
2
3
4
2
3
4
插件
# 代码复制按钮插件
npm install -g vuepress-plugin-nuggets-style-copy
# 回到顶部插件
npm install -g @vuepress/plugin-back-to-top
npm install -g vuepress-plugin-go-top
1
2
3
4
5
2
3
4
5
FAQ
npm install -D vuepress-plugin-export
报错:ERROR: Failed to download Chromium r686378! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
是因为在执行安装的过程中需要执行install.js,这里会下载Chromium,官网建议是进行跳过。 通过设置环境变量set PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 阻止下载 Chromium
入门
目录结构如下
sample
├── docs
│ ├── .vuepress
│ └── README.md
└── package.json
1
2
3
4
5
2
3
4
5
1.初始化
- 创建工作文件夹 sample
- 执行初始化命令
sample>npm init -y
1
2.配置
- 新建文件夹/docs
- 创建/docs/README.md文件
- 修改/package.json,添加下述兩行
{
"name": "sample",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs"
},
"keywords": [],
"author": "",
"license": "ISC"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
3.运行
docs>npm run docs:dev
1
4.编译
docs>npm run docs:build
1