Skip to content

Commit

Permalink
chore(docs): adds remark-lint, fix #1741
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahdayan authored Aug 8, 2019
2 parents ecf4fc9 + 7a13eed commit b107245
Show file tree
Hide file tree
Showing 30 changed files with 1,443 additions and 341 deletions.
9 changes: 9 additions & 0 deletions packages/docs/.remarkrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"plugins": [
"preset-lint-recommended",
"preset-lint-consistent",

["lint-list-item-indent", "space"],
["lint-heading-style", false]
]
}
22 changes: 11 additions & 11 deletions packages/docs/docs/guide/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ pages:

1. On Netlify, setup up a new project from GitHub with the following settings:

- **Build Command:** `npm run docs:build` or `yarn docs:build`
- **Publish directory:** `docs/.vuepress/dist`
- **Build Command:** `npm run docs:build` or `yarn docs:build`
- **Publish directory:** `docs/.vuepress/dist`

2. Hit the deploy button!

Expand Down Expand Up @@ -169,18 +169,18 @@ You can also deploy to a [custom domain](http://surge.sh/help/adding-a-custom-do

3. Run `heroku login` and fill in your Heroku credentials:

``` bash
heroku login
```
``` bash
heroku login
```

4. Create a file called `static.json` in the root of your project with the content below:

`static.json`:
```json
{
"root": "./docs/.vuepress/dist"
}
```
`static.json`:
```json
{
"root": "./docs/.vuepress/dist"
}
```

This is the configuration of your site. See more at [heroku-buildpack-static](https://github.com/heroku/heroku-buildpack-static).

Expand Down
8 changes: 8 additions & 0 deletions packages/docs/docs/guide/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ A list of all emojis available can be found [here](https://github.com/markdown-i

**Output**

<!--lint disable no-shortcut-reference-link no-undefined-references-->

[[toc]]

<!--lint enable no-shortcut-reference-link no-undefined-references-->

Rendering of TOC can be configured using the [`markdown.toc`](../config/README.md#markdown-toc) option.

## Custom Containers <Badge text="default theme"/>
Expand Down Expand Up @@ -311,8 +315,12 @@ It also supports [line highlighting](#line-highlighting-in-code-blocks):

**Output**

<!--lint disable strong-marker-->

<<< @/../@vuepress/markdown/__tests__/fragments/snippet.js{2}

<!--lint enable strong-marker-->

::: tip
Since the import of the code snippets will be executed before webpack compilation, you can’t use the path alias in webpack. The default value of `@` is `process.cwd()`.
:::
Expand Down
20 changes: 11 additions & 9 deletions packages/docs/docs/guide/permalinks.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ We have seen the shadow of the blog. Let’s continue to look down.

## Permalinks

A permalink is a URL that is intended to remain unchanged for a long time, yielding a hyperlink that is less susceptible to link root<sup>[1]</sup>. VuePress supports a flexible way to build permalinks, allowing you to use template variables.
A permalink is a URL that is intended to remain unchanged for a long time, yielding a hyperlink that is less susceptible to link root<sup>[1][1]</sup>. VuePress supports a flexible way to build permalinks, allowing you to use template variables.

The default permalink is `/:regular`.

Expand Down Expand Up @@ -64,11 +64,13 @@ Hello!
### Template Variables

| Variable | Description |
|---|---|
|:year|Published year of posts (4-digit)|
|:month|Published month of posts (2-digit)|
|:i_month|Published month of posts (Without leading zeros)|
|:day|Published day of posts (2-digit)|
|:i_day|Published day of posts (Without leading zeros)|
|:slug|Slugified file path (Without extension)|
|:regular| Permalink generated by VuePress by default, for implementation see [here](https://github.com/vuejs/vuepress/blob/master/packages/%40vuepress/shared-utils/src/fileToPath.ts) |
| --- | --- |
| :year | Published year of posts (4-digit) |
| :month | Published month of posts (2-digit) |
| :i_month | Published month of posts (Without leading zeros) |
| :day | Published day of posts (2-digit) |
| :i_day | Published day of posts (Without leading zeros) |
| :slug | Slugified file path (Without extension) |
| :regular | Permalink generated by VuePress by default, for implementation see [here](https://github.com/vuejs/vuepress/blob/master/packages/%40vuepress/shared-utils/src/fileToPath.ts) |

[1]:https://en.wikipedia.org/wiki/Link_rot
6 changes: 3 additions & 3 deletions packages/docs/docs/guide/using-vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ Specify a specific slot for a specific page (.md) for rendering. This will be us

- **Props**:

- `text` - string
- `type` - string, optional value: `"tip"|"warn"|"error"`, defaults to `"tip"`.
- `vertical` - string, optional value: `"top"|"middle"`, defaults to `"top"`.
- `text` - string
- `type` - string, optional value: `"tip"|"warn"|"error"`, defaults to `"tip"`.
- `vertical` - string, optional value: `"top"|"middle"`, defaults to `"top"`.

- **Usage**:

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/plugin/life-cycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = {
- Type: `AsyncFunction`
- Scope:`build`

Called when a (production) build finishes, with an array of generated page HTML paths.
Called when a (production) build finishes, with an array of generated page HTML paths.

``` js
module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/plugin/official/plugin-back-to-top.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ yarn add -D @vuepress/plugin-back-to-top@next

```javascript
module.exports = {
plugins: ['@vuepress/back-to-top']
plugins: ['@vuepress/back-to-top']
}
```
6 changes: 3 additions & 3 deletions packages/docs/docs/plugin/official/plugin-google-analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ yarn add -D @vuepress/plugin-google-analytics@next
```javascript
module.exports = {
plugins: [
[
[
'@vuepress/google-analytics',
{
'ga': '' // UA-00000000-0
}
]
]
]
]
}
```

Expand Down
4 changes: 2 additions & 2 deletions packages/docs/docs/plugin/official/plugin-last-updated.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you use it at your custom theme, you'll need to handle the UI by yourself, an

```js
module.exports = {
plugins: ['@vuepress/last-updated']
plugins: ['@vuepress/last-updated']
}
```

Expand All @@ -35,7 +35,7 @@ const moment = require('moment');

module.exports = {
plugins: [
[
[
'@vuepress/last-updated',
{
transformer: (timestamp, lang) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/plugin/official/plugin-nprogress.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ Set `$nprogressColor` in your __site__ or __theme__ `palette.styl` file to chang
$nprogressColor = red
```

**Also see:**
__Also see:__

- [Config Reference > Styling](../../config/README.md#styling)
10 changes: 5 additions & 5 deletions packages/docs/docs/plugin/official/plugin-register-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ All components in this directory will be registered as global components, naming
``` js
module.exports = {
plugins: [
[
'register-components',
[
'register-components',
{
componentsDir: somepath
}
]
]
]
}
```

Expand All @@ -54,8 +54,8 @@ Register global components by explicit name and path.
``` js
module.exports = {
plugins: [
[
'register-components',
[
'register-components',
{
components: [
{
Expand Down
12 changes: 6 additions & 6 deletions packages/docs/docs/plugin/official/plugin-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Note that this plugin has been included in **default theme**, the search box you
module.exports = {
plugins: [
['@vuepress/search', {
searchMaxSuggestions: 10
searchMaxSuggestions: 10
}]
]
}
Expand Down Expand Up @@ -74,17 +74,17 @@ Set up searchable paths with regular expressions. If no test expression is provi

```bash
docs/
├── .vuepress/
├── .vuepress/
│ └── ...
├── master/
├── master/
│ └── ...
├── 1.0/
├── 1.0/
│ └── ...
└── 2.0/
└── ...
└── 2.0/
└── ...
```

You can set up searchable paths with `test` as:
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/theme/inheritance.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ We have two main reasons to support this feature:

2. In [0.x](https://vuepress.vuejs.org/guide/custom-themes.html#site-and-page-metadata), only one `Layout.vue` is needed for a theme, so we can achieve simple expansion by directly wrapping `Layout.vue` of another theme.

By 1.x, the elements of a theme has become more complex, we have started to have [theme level configuration](./option-api.md), which supports plugins, custom global layout, etc. We have also introduced the [directory structure conventions](./writing-a-theme.md#directory-structure) on theme development, such as `styles/index.styl`, under this background, we can not achieve inheritance as 0.x did.
By 1.x, the elements of a theme has become more complex, we have started to have [theme level configuration](./option-api.md), which supports plugins, custom global layout, etc. We have also introduced the [directory structure conventions](./writing-a-theme.md#directory-structure) on theme development, such as `styles/index.styl`, under this background, we can not achieve inheritance as 0.x did.

Consequently, we need to provide a reasonable and reliable theme inheritance strategy.

Expand Down
10 changes: 5 additions & 5 deletions packages/docs/docs/zh/guide/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ pages:

1. 在 Netlify 中, 创建一个新的 GitHub 项目,使用以下设置:

- **Build Command:** `npm run build:docs` 或者 `yarn build:docs`
- **Publish directory:** `docs/.vuepress/dist`
- **Build Command:** `npm run build:docs` 或者 `yarn build:docs`
- **Publish directory:** `docs/.vuepress/dist`

2. 点击 deploy 按钮!

Expand Down Expand Up @@ -167,9 +167,9 @@ pages:

3. 运行 `heroku login` 并填写你的 Heroku 证书:

``` bash
heroku login
```
``` bash
heroku login
```

4. 在你的项目根目录中,创建一个名为 `static.json` 的文件,并包含下述内容:

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/zh/guide/directory-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ VuePress 遵循 **“约定优于配置”** 的原则,推荐的目录结构
当你想要去自定义 `templates/ssr.html``templates/dev.html` 时,最好基于 [默认的模板文件](https://github.com/vuejs/vuepress/blob/master/packages/%40vuepress/core/lib/app/index.dev.html) 来修改,否则可能会导致构建出错。
:::

**同时阅读:**
**同时阅读:**

- [配置](../config/README.md)
- [主题](../theme/README.md)
Expand Down
12 changes: 10 additions & 2 deletions packages/docs/docs/zh/guide/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,12 @@ lang: en-US

**输出**

<!--lint disable no-shortcut-reference-link no-undefined-references-->

[[toc]]

<!--lint enable no-shortcut-reference-link no-undefined-references-->

目录(Table of Contents)的渲染可以通过 [`markdown.toc`](../config/README.md#markdown-toc) 选项来配置。

## 自定义容器 <Badge text="默认主题"/>
Expand Down Expand Up @@ -253,7 +257,7 @@ module.exports = {
markdown: {
lineNumbers: true
}
}
}
```

<!-- TODO Support line numbers for specific fence block -->
Expand Down Expand Up @@ -299,7 +303,7 @@ module.exports = {
它也支持 [行高亮](#代码块中的行高亮)

``` md
<<< @/filepath{highlightLines}
<<< @/filepath{highlightLines}
```

**输入**
Expand All @@ -310,8 +314,12 @@ module.exports = {

**输出**

<!--lint disable strong-marker-->

<<< @/../@vuepress/markdown/__tests__/fragments/snippet.js{2}

<!--lint enable strong-marker-->

::: tip 注意
由于代码段的导入将在 webpack 编译之前执行,因此你无法使用 webpack 中的路径别名,此处的 `@` 默认值是 `process.cwd()`
:::
Expand Down
14 changes: 7 additions & 7 deletions packages/docs/docs/zh/guide/permalinks.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ Hello!

| 变量 | 介绍 |
| --- | --- |
|:year|文章发布的年份 (4数字)|
|:month|文章发布的月份 (2数字)|
|:i_month|文章发布的月份 (前面不带0)|
|:day| 文章发布的日份 (2数字)|
|:i_day|文章发布的日份 (前面不带0)|
|:slug| 蛞蝓化文件路径 (不带扩展名)|
|:regular|VuePress默认的生成永久链接的方式,具体实现看 [这里][2]
| :year | 文章发布的年份 (4数字) |
| :month | 文章发布的月份 (2数字) |
| :i_month | 文章发布的月份 (前面不带0) |
| :day | 文章发布的日份 (2数字) |
| :i_day | 文章发布的日份 (前面不带0) |
| :slug | 蛞蝓化文件路径 (不带扩展名) |
| :regular | VuePress默认的生成永久链接的方式,具体实现看 [这里][2] |

[1]:https://en.wikipedia.org/wiki/Link_rot
[2]:https://github.com/vuejs/vuepress/blob/master/packages/%40vuepress/shared-utils/src/fileToPath.ts
8 changes: 4 additions & 4 deletions packages/docs/docs/zh/guide/using-vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export default {
- **Usage**

指定一个指定页面的特定 slot 用于渲染,当你使用 [自定义布局](../theme/default-theme-config.md#特定页面的自定义布局) 或者自定义主题时,这将非常有用。


``` vue
<Content/>
Expand All @@ -230,9 +230,9 @@ export default {

- **Props**:

- `text` - string
- `type` - string, 可选值: `"tip"|"warn"|"error"`,默认值是: `"tip"`
- `vertical` - string, 可选值: `"top"|"middle"`,默认值是: `"top"`
- `text` - string
- `type` - string, 可选值: `"tip"|"warn"|"error"`,默认值是: `"tip"`
- `vertical` - string, 可选值: `"top"|"middle"`,默认值是: `"top"`

- **Usage**:

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/zh/miscellaneous/design-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ module.exports = {
plugins: [
'vuepress-plugin-xxx',
{ name: 'bar' }
]
]
}
```

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/zh/miscellaneous/migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sidebar: auto

GA 已经被分离为一个单独的插件 [@vuepress/plugin-google-analytics](../plugin/official/plugin-google-analytics.md)

::: upgrade
::: upgrade

1. 安装 `@vuepress/plugin-google-analytics`:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ yarn add -D @vuepress/plugin-back-to-top@next

```javascript
module.exports = {
plugins: ['@vuepress/back-to-top']
plugins: ['@vuepress/back-to-top']
}
```
Loading

0 comments on commit b107245

Please sign in to comment.