Skip to content

Commit

Permalink
docs($cn): sync
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Feb 13, 2019
1 parent 1f28eef commit 83ff9ad
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/docs/docs/guide/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ deploy:
branch: master
```
## GitLab Pages and GitLab CI
### GitLab Pages and GitLab CI
1. Set correct `base` in `docs/.vuepress/config.js`.

Expand Down
27 changes: 26 additions & 1 deletion packages/docs/docs/zh/guide/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,32 @@ cd -
你可以在你的持续集成的设置中,设置在每次 push 代码时自动运行上述脚本。
:::

## GitLab Pages and GitLab CI
### Github Pages and Travis CI

1.`docs/.vuepress/config.js` 中设置正确的 `base`

如果你打算发布到 `https://<USERNAME or GROUP>.github.io/`,则可以省略这一步,因为 `base` 默认即是 `"/"`

如果你打算发布到 `https://<USERNAME or GROUP>.github.io/<REPO>/`(也就是说你的仓库在 `https://github.com/<USERNAME>/<REPO>`),则将 `base` 设置为 `"/<REPO>/"`

2. 在项目的根目录创建一个名为 `.travis.yml` 的文件;
3. 使用 Github Pages 部署提供程序模板并遵循 [Travis 文档](https://docs.travis ci.com/user/deployment/pages/)。

``` yaml
language: node_js
script:
- npm run docs:build
deploy:
provider: pages
skip-cleanup: true
local_dir: docs/.vuepress/dist
github-token: $GITHUB_TOKEN # a token generated on github allowing travis to push code on you repository
keep-history: true
on:
branch: master
```
### GitLab Pages and GitLab CI
1. 在 `docs/.vuepress/config.js` 中设置正确的 `base`。

Expand Down
55 changes: 55 additions & 0 deletions packages/docs/docs/zh/guide/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,61 @@ Danger zone, do not proceed
Danger zone, do not proceed
:::

## 代码块中的语法高亮

VuePress 使用了 [Prism](https://prismjs.com/) 来为 markdown 中的代码块实现语法高亮。Prism 支持大量的编程语言,你需要做的只是在代码块的开始倒勾中附加一个有效的语言别名:

**Input**

````
``` js
export default {
name: 'MyComponent',
// ...
}
```
````

**Output**

``` js
export default {
name: 'MyComponent',
// ...
}
```

**Input**

````
``` html
<ul>
<li
v-for="todo in todos"
:key="todo.id"
>
{{ todo.text }}
</li>
</ul>
```
````

**Output**

``` html
<ul>
<li
v-for="todo in todos"
:key="todo.id"
>
{{ todo.text }}
</li>
</ul>
```

在 Prism 的网站上查看 [合法的语言列表](https://prismjs.com/#languages-list)


## 代码块中的行高亮

**Input**
Expand Down

0 comments on commit 83ff9ad

Please sign in to comment.