Skip to content

docs: move extractHeader documentation to the right section #1980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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