@mdit-vue/plugin-toc 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -21,8 +21,8 @@ npm i @mdit-vue/plugin-toc
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
23
|
```ts
|
|
24
|
-
import MarkdownIt from 'markdown-it';
|
|
25
24
|
import { tocPlugin } from '@mdit-vue/plugin-toc';
|
|
25
|
+
import MarkdownIt from 'markdown-it';
|
|
26
26
|
|
|
27
27
|
const md = MarkdownIt({ html: true }).use(tocPlugin, {
|
|
28
28
|
// options
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MarkdownItHeader } from '@mdit-vue/types';
|
|
2
|
-
import ParserBlock from 'markdown-it/lib/parser_block.
|
|
3
|
-
import
|
|
2
|
+
import ParserBlock from 'markdown-it/lib/parser_block.mjs';
|
|
3
|
+
import { PluginWithOptions } from 'markdown-it';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Options of @mdit-vue/plugin-toc
|
|
@@ -57,7 +57,7 @@ interface TocPluginOptions {
|
|
|
57
57
|
*
|
|
58
58
|
* @default 'ul'
|
|
59
59
|
*/
|
|
60
|
-
listTag?: '
|
|
60
|
+
listTag?: 'ol' | 'ul';
|
|
61
61
|
/**
|
|
62
62
|
* The class for the TOC list
|
|
63
63
|
*
|
|
@@ -85,7 +85,7 @@ interface TocPluginOptions {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
type RenderHeadersFn = (headers: MarkdownItHeader[]) => string;
|
|
88
|
-
declare const createRenderHeaders: ({ listTag, listClass, itemClass, linkTag, linkClass, }: Pick<Required<TocPluginOptions>, '
|
|
88
|
+
declare const createRenderHeaders: ({ listTag, listClass, itemClass, linkTag, linkClass, }: Pick<Required<TocPluginOptions>, 'itemClass' | 'linkClass' | 'linkTag' | 'listClass' | 'listTag'>) => RenderHeadersFn;
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
* Forked and modified from markdown-it-toc-done-right
|
|
@@ -95,7 +95,7 @@ declare const createRenderHeaders: ({ listTag, listClass, itemClass, linkTag, li
|
|
|
95
95
|
*
|
|
96
96
|
* @see https://github.com/nagaozen/markdown-it-toc-done-right
|
|
97
97
|
*/
|
|
98
|
-
declare const createTocBlockRule: ({ pattern, containerTag, containerClass, }: Pick<Required<TocPluginOptions>, '
|
|
98
|
+
declare const createTocBlockRule: ({ pattern, containerTag, containerClass, }: Pick<Required<TocPluginOptions>, 'containerClass' | 'containerTag' | 'pattern'>) => ParserBlock.RuleBlock;
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* Generate table of contents
|
|
@@ -104,6 +104,6 @@ declare const createTocBlockRule: ({ pattern, containerTag, containerClass, }: P
|
|
|
104
104
|
*
|
|
105
105
|
* @see https://github.com/nagaozen/markdown-it-toc-done-right
|
|
106
106
|
*/
|
|
107
|
-
declare const tocPlugin:
|
|
107
|
+
declare const tocPlugin: PluginWithOptions<TocPluginOptions>;
|
|
108
108
|
|
|
109
109
|
export { type TocPluginOptions, createRenderHeaders, createTocBlockRule, tocPlugin };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MarkdownItHeader } from '@mdit-vue/types';
|
|
2
|
-
import ParserBlock from 'markdown-it/lib/parser_block.
|
|
3
|
-
import
|
|
2
|
+
import ParserBlock from 'markdown-it/lib/parser_block.mjs';
|
|
3
|
+
import { PluginWithOptions } from 'markdown-it';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Options of @mdit-vue/plugin-toc
|
|
@@ -57,7 +57,7 @@ interface TocPluginOptions {
|
|
|
57
57
|
*
|
|
58
58
|
* @default 'ul'
|
|
59
59
|
*/
|
|
60
|
-
listTag?: '
|
|
60
|
+
listTag?: 'ol' | 'ul';
|
|
61
61
|
/**
|
|
62
62
|
* The class for the TOC list
|
|
63
63
|
*
|
|
@@ -85,7 +85,7 @@ interface TocPluginOptions {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
type RenderHeadersFn = (headers: MarkdownItHeader[]) => string;
|
|
88
|
-
declare const createRenderHeaders: ({ listTag, listClass, itemClass, linkTag, linkClass, }: Pick<Required<TocPluginOptions>, '
|
|
88
|
+
declare const createRenderHeaders: ({ listTag, listClass, itemClass, linkTag, linkClass, }: Pick<Required<TocPluginOptions>, 'itemClass' | 'linkClass' | 'linkTag' | 'listClass' | 'listTag'>) => RenderHeadersFn;
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
* Forked and modified from markdown-it-toc-done-right
|
|
@@ -95,7 +95,7 @@ declare const createRenderHeaders: ({ listTag, listClass, itemClass, linkTag, li
|
|
|
95
95
|
*
|
|
96
96
|
* @see https://github.com/nagaozen/markdown-it-toc-done-right
|
|
97
97
|
*/
|
|
98
|
-
declare const createTocBlockRule: ({ pattern, containerTag, containerClass, }: Pick<Required<TocPluginOptions>, '
|
|
98
|
+
declare const createTocBlockRule: ({ pattern, containerTag, containerClass, }: Pick<Required<TocPluginOptions>, 'containerClass' | 'containerTag' | 'pattern'>) => ParserBlock.RuleBlock;
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* Generate table of contents
|
|
@@ -104,6 +104,6 @@ declare const createTocBlockRule: ({ pattern, containerTag, containerClass, }: P
|
|
|
104
104
|
*
|
|
105
105
|
* @see https://github.com/nagaozen/markdown-it-toc-done-right
|
|
106
106
|
*/
|
|
107
|
-
declare const tocPlugin:
|
|
107
|
+
declare const tocPlugin: PluginWithOptions<TocPluginOptions>;
|
|
108
108
|
|
|
109
109
|
export { type TocPluginOptions, createRenderHeaders, createTocBlockRule, tocPlugin };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MarkdownItHeader } from '@mdit-vue/types';
|
|
2
|
-
import ParserBlock from 'markdown-it/lib/parser_block.
|
|
3
|
-
import
|
|
2
|
+
import ParserBlock from 'markdown-it/lib/parser_block.mjs';
|
|
3
|
+
import { PluginWithOptions } from 'markdown-it';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Options of @mdit-vue/plugin-toc
|
|
@@ -57,7 +57,7 @@ interface TocPluginOptions {
|
|
|
57
57
|
*
|
|
58
58
|
* @default 'ul'
|
|
59
59
|
*/
|
|
60
|
-
listTag?: '
|
|
60
|
+
listTag?: 'ol' | 'ul';
|
|
61
61
|
/**
|
|
62
62
|
* The class for the TOC list
|
|
63
63
|
*
|
|
@@ -85,7 +85,7 @@ interface TocPluginOptions {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
type RenderHeadersFn = (headers: MarkdownItHeader[]) => string;
|
|
88
|
-
declare const createRenderHeaders: ({ listTag, listClass, itemClass, linkTag, linkClass, }: Pick<Required<TocPluginOptions>, '
|
|
88
|
+
declare const createRenderHeaders: ({ listTag, listClass, itemClass, linkTag, linkClass, }: Pick<Required<TocPluginOptions>, 'itemClass' | 'linkClass' | 'linkTag' | 'listClass' | 'listTag'>) => RenderHeadersFn;
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
* Forked and modified from markdown-it-toc-done-right
|
|
@@ -95,7 +95,7 @@ declare const createRenderHeaders: ({ listTag, listClass, itemClass, linkTag, li
|
|
|
95
95
|
*
|
|
96
96
|
* @see https://github.com/nagaozen/markdown-it-toc-done-right
|
|
97
97
|
*/
|
|
98
|
-
declare const createTocBlockRule: ({ pattern, containerTag, containerClass, }: Pick<Required<TocPluginOptions>, '
|
|
98
|
+
declare const createTocBlockRule: ({ pattern, containerTag, containerClass, }: Pick<Required<TocPluginOptions>, 'containerClass' | 'containerTag' | 'pattern'>) => ParserBlock.RuleBlock;
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* Generate table of contents
|
|
@@ -104,6 +104,6 @@ declare const createTocBlockRule: ({ pattern, containerTag, containerClass, }: P
|
|
|
104
104
|
*
|
|
105
105
|
* @see https://github.com/nagaozen/markdown-it-toc-done-right
|
|
106
106
|
*/
|
|
107
|
-
declare const tocPlugin:
|
|
107
|
+
declare const tocPlugin: PluginWithOptions<TocPluginOptions>;
|
|
108
108
|
|
|
109
109
|
export { type TocPluginOptions, createRenderHeaders, createTocBlockRule, tocPlugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mdit-vue/plugin-toc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A markdown-it plugin to generate table-of-contents that compatible with Vue.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown-it",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"test": "vitest"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@mdit-vue/shared": "2.
|
|
47
|
-
"@mdit-vue/types": "2.
|
|
48
|
-
"@types/markdown-it": "^
|
|
49
|
-
"markdown-it": "^14.
|
|
46
|
+
"@mdit-vue/shared": "2.1.0",
|
|
47
|
+
"@mdit-vue/types": "2.1.0",
|
|
48
|
+
"@types/markdown-it": "^14.0.0",
|
|
49
|
+
"markdown-it": "^14.1.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"markdown-it-anchor": "^8.6.7"
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "1d481f8238b3b0d5687e62e009e57ccacfc4a442"
|
|
58
58
|
}
|