Skip to content

Commit fa7d969

Browse files
TrottBethGriggs
authored andcommitted
tools: remove unused code in doc generation tool
tools/doc/html.js includes code that looks for comments with `start-include` and `end-include` for file inclusion. This seems to be legacy code that is no longer used. The code only appears in the table-of-contents generation function. The strings `start-include` and `end-include` appear nowhere else in our tools and nowhere at all in our docs. PR-URL: #32913 Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 95e897e commit fa7d969

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

‎tools/doc/html.js‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -313,23 +313,11 @@ function versionSort(a, b){
313313

314314
functionbuildToc({ filename, apilinks }){
315315
return(tree,file)=>{
316-
conststartIncludeRefRE=/^\s*<!--\[start-include:(.+)\]-->\s*$/;
317-
constendIncludeRefRE=/^\s*<!--\[end-include:.+\]-->\s*$/;
318-
constrealFilenames=[filename];
319316
constidCounters=Object.create(null);
320317
lettoc='';
321318
letdepth=0;
322319

323320
visit(tree,null,(node)=>{
324-
// Keep track of the current filename for comment wrappers of inclusions.
325-
if(node.type==='html'){
326-
const[,includedFileName]=node.value.match(startIncludeRefRE)||[];
327-
if(includedFileName!==undefined)
328-
realFilenames.unshift(includedFileName);
329-
elseif(endIncludeRefRE.test(node.value))
330-
realFilenames.shift();
331-
}
332-
333321
if(node.type!=='heading')return;
334322

335323
if(node.depth-depth>1){
@@ -339,7 +327,7 @@ function buildToc({filename, apilinks }){
339327
}
340328

341329
depth=node.depth;
342-
constrealFilename=path.basename(realFilenames[0],'.md');
330+
constrealFilename=path.basename(filename,'.md');
343331
constheadingText=file.contents.slice(
344332
node.children[0].position.start.offset,
345333
node.position.end.offset).trim();

0 commit comments

Comments
(0)