Skip to content

Commit b107245

Browse files
authored
chore(docs): adds remark-lint, fix #1741
2 parents ecf4fc9 + 7a13eed commit b107245

30 files changed

+1443
-341
lines changed

packages/docs/.remarkrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"plugins": [
3+
"preset-lint-recommended",
4+
"preset-lint-consistent",
5+
6+
["lint-list-item-indent", "space"],
7+
["lint-heading-style", false]
8+
]
9+
}

packages/docs/docs/guide/deploy.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ pages:
119119

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

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

125125
2. Hit the deploy button!
126126

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

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

172-
``` bash
173-
heroku login
174-
```
172+
``` bash
173+
heroku login
174+
```
175175

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

178-
`static.json`:
179-
```json
180-
{
181-
"root": "./docs/.vuepress/dist"
182-
}
183-
```
178+
`static.json`:
179+
```json
180+
{
181+
"root": "./docs/.vuepress/dist"
182+
}
183+
```
184184

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

packages/docs/docs/guide/markdown.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,12 @@ A list of all emojis available can be found [here](https://github.com/markdown-i
111111

112112
**Output**
113113

114+
<!--lint disable no-shortcut-reference-link no-undefined-references-->
115+
114116
[[toc]]
115117

118+
<!--lint enable no-shortcut-reference-link no-undefined-references-->
119+
116120
Rendering of TOC can be configured using the [`markdown.toc`](../config/README.md#markdown-toc) option.
117121

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

312316
**Output**
313317

318+
<!--lint disable strong-marker-->
319+
314320
<<< @/../@vuepress/markdown/__tests__/fragments/snippet.js{2}
315321

322+
<!--lint enable strong-marker-->
323+
316324
::: tip
317325
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()`.
318326
:::

packages/docs/docs/guide/permalinks.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ We have seen the shadow of the blog. Let’s continue to look down.
3333

3434
## Permalinks
3535

36-
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.
36+
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.
3737

3838
The default permalink is `/:regular`.
3939

@@ -64,11 +64,13 @@ Hello!
6464
### Template Variables
6565

6666
| Variable | Description |
67-
|---|---|
68-
|:year|Published year of posts (4-digit)|
69-
|:month|Published month of posts (2-digit)|
70-
|:i_month|Published month of posts (Without leading zeros)|
71-
|:day|Published day of posts (2-digit)|
72-
|:i_day|Published day of posts (Without leading zeros)|
73-
|:slug|Slugified file path (Without extension)|
74-
|: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) |
67+
| --- | --- |
68+
| :year | Published year of posts (4-digit) |
69+
| :month | Published month of posts (2-digit) |
70+
| :i_month | Published month of posts (Without leading zeros) |
71+
| :day | Published day of posts (2-digit) |
72+
| :i_day | Published day of posts (Without leading zeros) |
73+
| :slug | Slugified file path (Without extension) |
74+
| :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) |
75+
76+
[1]:https://en.wikipedia.org/wiki/Link_rot

packages/docs/docs/guide/using-vue.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ Specify a specific slot for a specific page (.md) for rendering. This will be us
229229

230230
- **Props**:
231231

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

236236
- **Usage**:
237237

packages/docs/docs/plugin/life-cycle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = {
3939
- Type: `AsyncFunction`
4040
- Scope:`build`
4141

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

4444
``` js
4545
module.exports = {

packages/docs/docs/plugin/official/plugin-back-to-top.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ yarn add -D @vuepress/plugin-back-to-top@next
1818

1919
```javascript
2020
module.exports = {
21-
plugins: ['@vuepress/back-to-top']
21+
plugins: ['@vuepress/back-to-top']
2222
}
2323
```

packages/docs/docs/plugin/official/plugin-google-analytics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ yarn add -D @vuepress/plugin-google-analytics@next
2020
```javascript
2121
module.exports = {
2222
plugins: [
23-
[
23+
[
2424
'@vuepress/google-analytics',
2525
{
2626
'ga': '' // UA-00000000-0
2727
}
28-
]
29-
]
28+
]
29+
]
3030
}
3131
```
3232

packages/docs/docs/plugin/official/plugin-last-updated.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you use it at your custom theme, you'll need to handle the UI by yourself, an
1515

1616
```js
1717
module.exports = {
18-
plugins: ['@vuepress/last-updated']
18+
plugins: ['@vuepress/last-updated']
1919
}
2020
```
2121

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

3636
module.exports = {
3737
plugins: [
38-
[
38+
[
3939
'@vuepress/last-updated',
4040
{
4141
transformer: (timestamp, lang) => {

packages/docs/docs/plugin/official/plugin-nprogress.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ Set `$nprogressColor` in your __site__ or __theme__ `palette.styl` file to chang
3434
$nprogressColor = red
3535
```
3636

37-
**Also see:**
37+
__Also see:__
3838

3939
- [Config Reference > Styling](../../config/README.md#styling)

packages/docs/docs/plugin/official/plugin-register-components.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ All components in this directory will be registered as global components, naming
3434
``` js
3535
module.exports = {
3636
plugins: [
37-
[
38-
'register-components',
37+
[
38+
'register-components',
3939
{
4040
componentsDir: somepath
4141
}
4242
]
43-
]
43+
]
4444
}
4545
```
4646

@@ -54,8 +54,8 @@ Register global components by explicit name and path.
5454
``` js
5555
module.exports = {
5656
plugins: [
57-
[
58-
'register-components',
57+
[
58+
'register-components',
5959
{
6060
components: [
6161
{

packages/docs/docs/plugin/official/plugin-search.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Note that this plugin has been included in **default theme**, the search box you
2727
module.exports = {
2828
plugins: [
2929
['@vuepress/search', {
30-
searchMaxSuggestions: 10
30+
searchMaxSuggestions: 10
3131
}]
3232
]
3333
}
@@ -74,17 +74,17 @@ Set up searchable paths with regular expressions. If no test expression is provi
7474

7575
```bash
7676
docs/
77-
├── .vuepress/
77+
├── .vuepress/
7878
│ └── ...
7979
80-
├── master/
80+
├── master/
8181
│ └── ...
8282
83-
├── 1.0/
83+
├── 1.0/
8484
│ └── ...
8585
86-
└── 2.0/
87-
└── ...
86+
└── 2.0/
87+
└── ...
8888
```
8989

9090
You can set up searchable paths with `test` as:

packages/docs/docs/theme/inheritance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ We have two main reasons to support this feature:
88

99
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.
1010

11-
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.
11+
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.
1212

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

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ pages:
116116

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

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

122122
2. 点击 deploy 按钮!
123123

@@ -167,9 +167,9 @@ pages:
167167

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

170-
``` bash
171-
heroku login
172-
```
170+
``` bash
171+
heroku login
172+
```
173173

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

packages/docs/docs/zh/guide/directory-structure.md

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

51-
**同时阅读:**
51+
**同时阅读:**
5252

5353
- [配置](../config/README.md)
5454
- [主题](../theme/README.md)

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,12 @@ lang: en-US
109109

110110
**输出**
111111

112+
<!--lint disable no-shortcut-reference-link no-undefined-references-->
113+
112114
[[toc]]
113115

116+
<!--lint enable no-shortcut-reference-link no-undefined-references-->
117+
114118
目录(Table of Contents)的渲染可以通过 [`markdown.toc`](../config/README.md#markdown-toc) 选项来配置。
115119

116120
## 自定义容器 <Badge text="默认主题"/>
@@ -253,7 +257,7 @@ module.exports = {
253257
markdown: {
254258
lineNumbers: true
255259
}
256-
}
260+
}
257261
```
258262

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

301305
``` md
302-
<<< @/filepath{highlightLines}
306+
<<< @/filepath{highlightLines}
303307
```
304308

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

311315
**输出**
312316

317+
<!--lint disable strong-marker-->
318+
313319
<<< @/../@vuepress/markdown/__tests__/fragments/snippet.js{2}
314320

321+
<!--lint enable strong-marker-->
322+
315323
::: tip 注意
316324
由于代码段的导入将在 webpack 编译之前执行,因此你无法使用 webpack 中的路径别名,此处的 `@` 默认值是 `process.cwd()`
317325
:::

packages/docs/docs/zh/guide/permalinks.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ Hello!
5858

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

6969
[1]:https://en.wikipedia.org/wiki/Link_rot
7070
[2]:https://github.com/vuejs/vuepress/blob/master/packages/%40vuepress/shared-utils/src/fileToPath.ts

packages/docs/docs/zh/guide/using-vue.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export default {
213213
- **Usage**
214214

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

218218
``` vue
219219
<Content/>
@@ -230,9 +230,9 @@ export default {
230230

231231
- **Props**:
232232

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

237237
- **Usage**:
238238

packages/docs/docs/zh/miscellaneous/design-concepts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ module.exports = {
179179
plugins: [
180180
'vuepress-plugin-xxx',
181181
{ name: 'bar' }
182-
]
182+
]
183183
}
184184
```
185185

packages/docs/docs/zh/miscellaneous/migration-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sidebar: auto
1010

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

13-
::: upgrade
13+
::: upgrade
1414

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

packages/docs/docs/zh/plugin/official/plugin-back-to-top.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ yarn add -D @vuepress/plugin-back-to-top@next
1818

1919
```javascript
2020
module.exports = {
21-
plugins: ['@vuepress/back-to-top']
21+
plugins: ['@vuepress/back-to-top']
2222
}
2323
```

0 commit comments

Comments
 (0)