@@ -99,6 +99,8 @@ export type Options = {
99
99
* Add babel plugins.
100
100
*/
101
101
babelPlugins? : PluginItem [];
102
+ /** Do you want to parse the title*/
103
+ isHeading? : boolean
102
104
}
103
105
` ` `
104
106
@@ -112,6 +114,7 @@ import mdObj from 'markdown-react-code-preview-loader/README.md';
112
114
mdObj .source // => `README.md` raw string text
113
115
mdObj .components // => The component index object, the React component converted from the markdown indexed example. (need to configure meta)
114
116
mdObj .data // => The component source code index object, the sample source code indexed from markdown. (need to configure meta)
117
+ mdObj .headings // => This is the parsed header data
115
118
```
116
119
117
120
``` js
@@ -133,7 +136,8 @@ mdObj.data // => The component source code index object, the sample source
133
136
}
134
137
},
135
138
components: { 77 : ƒ, demo12: ƒ },
136
- source: " # Alert 确认对话框...."
139
+ source: " # Alert 确认对话框...." ,
140
+ headings: [{depth: 1 ,value: " 标题" , ... },... ]
137
141
}
138
142
```
139
143
@@ -155,6 +159,7 @@ export type CodeBlockData = {
155
159
source: string ;
156
160
components: Record <CodeBlockItem [' name' ], React .FC >;
157
161
data: Record <CodeBlockItem [' name' ], CodeBlockItem >;
162
+ headings? : HeadingItem []
158
163
};
159
164
```
160
165
0 commit comments