astro-custom-toc 2.0.18 → 2.0.19
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.
|
@@ -4,7 +4,7 @@ import type { MarkdownHeading } from "@astrojs/markdown-remark";
|
|
|
4
4
|
/**
|
|
5
5
|
* A comment node generated by the `remark-comment` plugin.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
interface Comment extends Node {
|
|
8
8
|
type: "comment";
|
|
9
9
|
value: "";
|
|
10
10
|
commentValue: string;
|
|
@@ -22,11 +22,11 @@ declare module "mdast" {
|
|
|
22
22
|
* @param html HTML content of the TOC list
|
|
23
23
|
* @returns Wrapped HTML content
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
type RehypeCustomTocTemplate = (html: string) => string;
|
|
26
26
|
/**
|
|
27
27
|
* Options for the rehypeCustomToc plugin.
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
interface RehypeCustomTocOptions {
|
|
30
30
|
/**
|
|
31
31
|
* A function that takes the generated HTML and returns the final HTML.
|
|
32
32
|
* This can be used to wrap the generated HTML in a custom template.
|
|
@@ -68,4 +68,5 @@ declare module "vfile" {
|
|
|
68
68
|
* @param userOptions Options for the plugin
|
|
69
69
|
* @returns The plugin
|
|
70
70
|
*/
|
|
71
|
-
|
|
71
|
+
declare const rehypeCustomToc: Plugin<[RehypeCustomTocOptions], Root>;
|
|
72
|
+
export { type Comment, type RehypeCustomTocTemplate, type RehypeCustomTocOptions, rehypeCustomToc };
|
|
@@ -81,7 +81,7 @@ const generateToc = (options, headings) => {
|
|
|
81
81
|
* @param userOptions Options for the plugin
|
|
82
82
|
* @returns The plugin
|
|
83
83
|
*/
|
|
84
|
-
|
|
84
|
+
const rehypeCustomToc = (userOptions) => {
|
|
85
85
|
const options = { ...DEFAULT_OPTIONS, ...userOptions };
|
|
86
86
|
/**
|
|
87
87
|
* The transformer function for the plugin.
|
|
@@ -114,3 +114,4 @@ export const rehypeCustomToc = (userOptions) => {
|
|
|
114
114
|
};
|
|
115
115
|
return transformer;
|
|
116
116
|
};
|
|
117
|
+
export { rehypeCustomToc };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro-custom-toc",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.19",
|
|
4
4
|
"description": "Astro Integration to generate a customizable table of contents",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"provenance": true
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@changesets/changelog-github": "^0.5.0",
|
|
55
55
|
"@changesets/cli": "^2.27.1",
|
|
56
|
-
"@robot-inventor/eslint-config": "^
|
|
56
|
+
"@robot-inventor/eslint-config": "^4.0.0",
|
|
57
|
+
"@robot-inventor/tsconfig-base": "^1.1.0",
|
|
57
58
|
"eslint": "^9.0.0",
|
|
58
59
|
"prettier": "^3.2.5"
|
|
59
60
|
}
|