Lines Matching full:toc
3 const { generateGfmToc } = require('@not-dalia/gfm-toc');
13 // ToC entries we don't want, for deletion
23 // see gfm-toc docs
60 // go through the lines, looking for the header to the old ToC.
62 out.push(lines[i]); // Emit the header line for the old ToC
68 throw Error(`in ${f}: ran out of lines looking for start of ToC`);
71 out.push(''); // blank line before ToC
73 // Generate the ToC
74 let toc = generateGfmToc(contents, gfmOpts);
76 // Delete any patterns in tocDelete from the ToC
78 if (pat.test(toc[0])) {
79 toc = toc.splice(1); // delete first entry
83 // Push the whole ToC out
84 out.push(toc.join('\n'));
87 // Now, look for the end of the old ToC
88 // (the next section following the old ToC)
95 throw Error(`in ${f}: ran out of lines looking for end of ToC`);
119 toclines: toc.length