Skip to content

Commit 98977c9

Browse files
kefranabgmeteorlxy
authored andcommitted
docs: move extractHeader documentation to the right section (#1980)
1 parent 6aaff68 commit 98977c9

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

packages/docs/docs/config/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,21 @@ module.exports = {
300300
This option is also included in [Plugin API](../plugin/option-api.md#extendmarkdown).
301301
:::
302302

303+
### markdown.extractHeaders
304+
305+
- Type: `Array`
306+
- Default: `['h2', 'h3']`
307+
308+
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.
309+
310+
``` js
311+
module.exports = {
312+
markdown: {
313+
extractHeaders: [ 'h2', 'h3', 'h4' ]
314+
}
315+
}
316+
```
317+
303318
## Build Pipeline
304319

305320
:::tip Configuring CSS Pre-processors

packages/docs/docs/theme/default-theme-config.md

-11
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,6 @@ module.exports = {
182182
}
183183
```
184184

185-
### Extract Headers
186-
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.
187-
You can override the headers it pulls out in your `markdown` options.
188-
``` js
189-
module.exports = {
190-
markdown: {
191-
extractHeaders: [ 'h2', 'h3', 'h4' ]
192-
}
193-
}
194-
```
195-
196185
### Active Header Links
197186

198187
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:

packages/docs/docs/zh/config/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,21 @@ module.exports = {
292292
这个选项也被 [Plugin API](../plugin/option-api.md#extendmarkdown) 所支持。
293293
:::
294294

295+
### markdown.extractHeaders
296+
297+
- 类型: `Array`
298+
- 默认值: `['h2', 'h3']`
299+
300+
Markdown 文件的 headers (标题 & 小标题) 会在准备阶段被提取出来,并存储在 `this.$page.headers` 中。默认情况下,VuePress 会提取 `h2``h3` 标题。你可以通过这个选项来修改提取出的标题级别。
301+
302+
``` js
303+
module.exports = {
304+
markdown: {
305+
extractHeaders: [ 'h2', 'h3', 'h4' ]
306+
}
307+
}
308+
```
309+
295310
## 构建流程
296311

297312
### postcss

0 commit comments

Comments
 (0)