Skip to content

Commit 83ff9ad

Browse files
committedFeb 13, 2019
docs($cn): sync
1 parent 1f28eef commit 83ff9ad

File tree

3 files changed

+82
-2
lines changed

3 files changed

+82
-2
lines changed
 

‎packages/docs/docs/guide/deploy.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ deploy:
8282
branch: master
8383
```
8484
85-
## GitLab Pages and GitLab CI
85+
### GitLab Pages and GitLab CI
8686
8787
1. Set correct `base` in `docs/.vuepress/config.js`.
8888

‎packages/docs/docs/zh/guide/deploy.md

+26-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,32 @@ cd -
5656
你可以在你的持续集成的设置中,设置在每次 push 代码时自动运行上述脚本。
5757
:::
5858

59-
## GitLab Pages and GitLab CI
59+
### Github Pages and Travis CI
60+
61+
1.`docs/.vuepress/config.js` 中设置正确的 `base`
62+
63+
如果你打算发布到 `https://<USERNAME or GROUP>.github.io/`,则可以省略这一步,因为 `base` 默认即是 `"/"`
64+
65+
如果你打算发布到 `https://<USERNAME or GROUP>.github.io/<REPO>/`(也就是说你的仓库在 `https://github.com/<USERNAME>/<REPO>`),则将 `base` 设置为 `"/<REPO>/"`
66+
67+
2. 在项目的根目录创建一个名为 `.travis.yml` 的文件;
68+
3. 使用 Github Pages 部署提供程序模板并遵循 [Travis 文档](https://docs.travis ci.com/user/deployment/pages/)。
69+
70+
``` yaml
71+
language: node_js
72+
script:
73+
- npm run docs:build
74+
deploy:
75+
provider: pages
76+
skip-cleanup: true
77+
local_dir: docs/.vuepress/dist
78+
github-token: $GITHUB_TOKEN # a token generated on github allowing travis to push code on you repository
79+
keep-history: true
80+
on:
81+
branch: master
82+
```
83+
84+
### GitLab Pages and GitLab CI
6085
6186
1. 在 `docs/.vuepress/config.js` 中设置正确的 `base`。
6287

‎packages/docs/docs/zh/guide/markdown.md

+55
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,61 @@ Danger zone, do not proceed
160160
Danger zone, do not proceed
161161
:::
162162

163+
## 代码块中的语法高亮
164+
165+
VuePress 使用了 [Prism](https://prismjs.com/) 来为 markdown 中的代码块实现语法高亮。Prism 支持大量的编程语言,你需要做的只是在代码块的开始倒勾中附加一个有效的语言别名:
166+
167+
**Input**
168+
169+
````
170+
``` js
171+
export default {
172+
name: 'MyComponent',
173+
// ...
174+
}
175+
```
176+
````
177+
178+
**Output**
179+
180+
``` js
181+
export default {
182+
name: 'MyComponent',
183+
// ...
184+
}
185+
```
186+
187+
**Input**
188+
189+
````
190+
``` html
191+
<ul>
192+
<li
193+
v-for="todo in todos"
194+
:key="todo.id"
195+
>
196+
{{ todo.text }}
197+
</li>
198+
</ul>
199+
```
200+
````
201+
202+
**Output**
203+
204+
``` html
205+
<ul>
206+
<li
207+
v-for="todo in todos"
208+
:key="todo.id"
209+
>
210+
{{ todo.text }}
211+
</li>
212+
</ul>
213+
```
214+
215+
在 Prism 的网站上查看 [合法的语言列表](https://prismjs.com/#languages-list)
216+
217+
163218
## 代码块中的行高亮
164219

165220
**Input**

0 commit comments

Comments
 (0)
Please sign in to comment.