You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(markdown): externalize headers and title plugin
BREAKING CHANGE: `markdown.extractHeaders` has been renamed to `markdown.headers`
BREAKING CHANGE: `markdown.extractTitle` has been renamed to `markdown.title`
Options for VuePress built-in markdown-it extract-headers plugin.
498
-
499
-
It will extract page headers to page data, which would be used for generating sidebar, table of contents, etc. For example, the sidebar of current page is auto generated from the headers that extracted by this plugin.
497
+
Options for [@mdit-vue/plugin-headers](https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-headers).
500
498
501
499
Set to `false` to disable this plugin.
502
500
503
501
- Also see:
504
502
-[Node API > Page Properties > headers](./node-api.md#headers)
505
503
506
-
#### markdown.extractHeaders.level
507
-
508
-
- Type: `number[]`
509
-
510
-
- Default: `[2, 3]`
511
-
512
-
- Details:
513
-
514
-
Header levels that going to be extracted.
515
-
516
-
For example, if you set this option to `[2]`, only `##` headers will be extracted.
517
-
518
-
Should be a subset of [markdown.anchor.level](#markdown-anchor) option to ensure the extracted links are existed.
519
-
520
-
#### markdown.extractHeaders.slugify
521
-
522
-
- Type: `(str: string) => string`
523
-
524
-
- Details:
525
-
526
-
A function to get the extracted slug of header from the raw header title.
527
-
528
-
Should use the same slugify function with [markdown.anchor.slugify](#markdown-anchor) to ensure the links are matched.
529
-
530
-
::: tip
531
-
If you really want to modify the slugify function, you'd better change the [markdown.slugify](#markdown-slugify) option instead of this one. Otherwise you have to set all the options about slugify function to ensure they are consistent.
532
-
:::
533
-
534
-
#### markdown.extractHeaders.format
535
-
536
-
- Type: `((str: string) => string) | undefined`
537
-
538
-
- Default: `undefined`
539
-
540
-
- Details:
541
-
542
-
A function to format the extracted title of header from the raw header title.
543
-
544
-
### markdown.extractTitle
545
-
546
-
- Type: `undefined | false`
547
-
548
-
- Details:
549
-
550
-
Options for VuePress built-in markdown-it extract-title plugin.
551
-
552
-
It will extract title to page data, which will be used as the page title.
553
-
554
-
Set to `false` to disable this plugin.
555
-
556
-
::: danger
557
-
You should not configure it unless you understand what it is for.
558
-
:::
559
-
560
504
### markdown.importCode
561
505
562
506
- Type: `ImportCodePluginOptions | false`
@@ -639,6 +583,20 @@ You should not configure it unless you understand what it is for.
639
583
640
584
The default slugify function.
641
585
586
+
### markdown.title
587
+
588
+
- Type: `undefined | false`
589
+
590
+
- Details:
591
+
592
+
Options for [@mdit-vue/plugin-title](https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-title).
593
+
594
+
Set to `false` to disable this plugin.
595
+
596
+
::: danger
597
+
You should not configure it unless you understand what it is for.
0 commit comments