Skip to content

Commit

Permalink
docs: move extractHeader documentation to the right section (#1980)
Browse files Browse the repository at this point in the history
  • Loading branch information
kefranabg authored and meteorlxy committed Oct 26, 2019
1 parent 6aaff68 commit 98977c9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
15 changes: 15 additions & 0 deletions packages/docs/docs/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,21 @@ module.exports = {
This option is also included in [Plugin API](../plugin/option-api.md#extendmarkdown).
:::

### markdown.extractHeaders

- Type: `Array`
- Default: `['h2', 'h3']`

While preparing the page, headers are extracted from the Markdown file and stored in `this.$page.headers`. By default, VuePress will extract `h2` and `h3` elements for you. You can override the headers it pulls out in your `markdown` options.

``` js
module.exports = {
markdown: {
extractHeaders: [ 'h2', 'h3', 'h4' ]
}
}
```

## Build Pipeline

:::tip Configuring CSS Pre-processors
Expand Down
11 changes: 0 additions & 11 deletions packages/docs/docs/theme/default-theme-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,6 @@ module.exports = {
}
```

### Extract Headers
While preparing the page, headers are extracted from the Markdown file and stored in `this.$page.headers`. By default, VuePress will extract `h2` and `h3` elements for you.
You can override the headers it pulls out in your `markdown` options.
``` js
module.exports = {
markdown: {
extractHeaders: [ 'h2', 'h3', 'h4' ]
}
}
```

### Active Header Links

By default, the nested header links and the hash in the URL are updated as the user scrolls to view the different sections of the page. This behavior can be disabled with the following theme config:
Expand Down
15 changes: 15 additions & 0 deletions packages/docs/docs/zh/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,21 @@ module.exports = {
这个选项也被 [Plugin API](../plugin/option-api.md#extendmarkdown) 所支持。
:::

### markdown.extractHeaders

- 类型: `Array`
- 默认值: `['h2', 'h3']`

Markdown 文件的 headers (标题 & 小标题) 会在准备阶段被提取出来,并存储在 `this.$page.headers` 中。默认情况下,VuePress 会提取 `h2``h3` 标题。你可以通过这个选项来修改提取出的标题级别。

``` js
module.exports = {
markdown: {
extractHeaders: [ 'h2', 'h3', 'h4' ]
}
}
```

## 构建流程

### postcss
Expand Down

0 comments on commit 98977c9

Please sign in to comment.