GeezerVison is showing github.com — tools: avoid pending deprecation in doc generator · nodejs/node@2ba6db3
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: tools/doc/html.js +7-2Lines changed: 7 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
24 | 24 | const common = require('./common.js'); |
25 | 25 | const fs = require('fs'); |
26 | 26 | const unified = require('unified'); |
27 | | -const find = require('unist-util-find'); |
28 | 27 | const visit = require('unist-util-visit'); |
29 | 28 | const markdown = require('remark-parse'); |
30 | 29 | const gfm = require('remark-gfm'); |
@@ -97,7 +96,13 @@ function toHTML({ input, content, filename, nodeVersion, versions }) { |
97 | 96 | // Set the section name based on the first header. Default to 'Index'. |
98 | 97 | function firstHeader() { |
99 | 98 | return (tree, file) => { |
100 | | - const heading = find(tree, { type: 'heading' }); |
| 99 | + let heading; |
| 100 | + visit(tree, (node) => { |
| 101 | + if (node.type === 'heading') { |
| 102 | + heading = node; |
| 103 | + return false; |
| 104 | + } |
| 105 | + }); |
101 | 106 |
|
102 | 107 | if (heading && heading.children.length) { |
103 | 108 | const recursiveTextContent = (node) => |
|
Collapse file
Copy file name to clipboardExpand all lines: tools/doc/package-lock.json -83Lines changed: 0 additions & 83 deletions Collapse file
Copy file name to clipboardExpand all lines: tools/doc/package.json -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
17 | 17 | "remark-rehype": "8.0.0", |
18 | 18 | "to-vfile": "6.1.0", |
19 | 19 | "unified": "9.2.0", |
20 | | - "unist-util-find": "^1.0.2", |
21 | 20 | "unist-util-select": "3.0.4", |
22 | 21 | "unist-util-visit": "2.0.3" |
23 | 22 | }, |
|