@@ -81,7 +81,7 @@ fetch(currentTagsUrl)
81
81
function processTemplate ( t , dir , supertag ) {
82
82
// all tags are with this kind and leading capital letter
83
83
if ( t . kind !== "member" || ! t . name . match ( / ^ [ A - Z ] / ) ) return ;
84
- if ( ! supertag && t . customTags && t . customTags . find ( ( desc ) => desc . tag === "subtag" ) ) return ;
84
+ // if (!supertag && t.customTags && t.customTags.find((desc) => desc.tag === "subtag")) return;
85
85
const name = t . name . toLowerCase ( ) ;
86
86
// there are no new tags if we didn't get the list
87
87
const isNew = tags ? ! tags . includes ( name ) : false ;
@@ -145,15 +145,15 @@ fetch(currentTagsUrl)
145
145
. renderSync ( { data : [ t ] , "example-lang" : "html" } )
146
146
// add header with info instead of header for github
147
147
// don't add any header to subtags as they'll be inserted into supertag's doc
148
- . replace ( / ^ ( .* ?\n ) { 3 } / , header )
148
+ // .replace(/^(.*?\n){3}/, header)
149
149
// remove useless Kind: member
150
- . replace ( / \* \* K i n d \* \* .* ?\n / , "### Parameters\n" )
151
- . replace ( / ( \* \* E x a m p l e \* \* \s * \n ) / , ` ${ results } $1` )
152
- . replace ( / \* \* E x a m p l e \* \* \s * \n / g, "### Example\n" )
150
+ . replace ( / ^ . * ? \* \* K i n d \* \* .* ?\n / ms , "### Parameters\n" )
151
+ . replace ( / \* \* E x a m p l e \* \* \s * \n . * / ms , results )
152
+ // .replace(/\*\*Example\*\*\s*\n/g, "### Example\n")
153
153
// move comments from examples to description
154
- . replace ( / ` ` ` h t m l [ \n \s ] * < ! - - [ \n \s ] * ( [ \w \W ] * ?) [ \n \s ] * - - > [ \n \s ] * / g, "\n$1\n\n```html\n" )
154
+ // .replace(/```html[\n\s]*<!--[\n\s]*([\w\W]*?)[\n\s]*-->[\n\s]*/g, "\n$1\n\n```html\n")
155
155
// change example language if it looks like JSON
156
- . replace ( / ` ` ` h t m l [ \n \s ] * ( [ [ { ] ) / g, "```json\n$1" )
156
+ // .replace(/```html[\n\s]*([[{])/g, "```json\n$1")
157
157
// normalize footnotes to be numbers (e.g. `[^FF_LSDV_0000]` => `[^1]`)
158
158
. replace (
159
159
/ \[ \^ ( [ ^ \] ] + ) \] / g,
@@ -172,19 +172,19 @@ fetch(currentTagsUrl)
172
172
// force adding new lines before footnote definitions
173
173
. replace ( / (?< ! [ \r \n ] ) ( [ \r \n ] ) ( \[ \^ [ ^ \[ ] + \] : ) / gm, "$1$1$2" ) ;
174
174
175
- if ( supertags . includes ( t . name ) ) {
176
- console . log ( `Fetching subtags of ${ t . name } ` ) ;
177
- const templates = jsdoc2md . getTemplateDataSync ( { files : `${ t . meta . path } /${ t . name } /*.${ EXT } ` } ) ;
178
- const subtags = templates
179
- . map ( ( t ) => processTemplate ( t , dir , t . name ) )
180
- . filter ( Boolean )
181
- . join ( "\n\n" ) ;
182
-
183
- if ( subtags ) {
184
- // insert before the first example or just at the end of doc
185
- str = str . replace ( / ( # # # E x a m p l e ) | $ / , `${ subtags } \n$1` ) ;
186
- }
187
- }
175
+ // if (supertags.includes(t.name)) {
176
+ // console.log(`Fetching subtags of ${t.name}`);
177
+ // const templates = jsdoc2md.getTemplateDataSync({ files: `${t.meta.path}/${t.name}/*.${EXT}` });
178
+ // const subtags = templates
179
+ // .map((t) => processTemplate(t, dir, t.name))
180
+ // .filter(Boolean)
181
+ // .join("\n\n");
182
+
183
+ // if (subtags) {
184
+ // // insert before the first example or just at the end of doc
185
+ // str = str.replace(/(### Example)|$/, `${subtags}\n$1`);
186
+ // }
187
+ // }
188
188
189
189
return str ;
190
190
}
0 commit comments