Skip to content

Commit 93362d5

Browse files
authored
chore: Updated doc generator for typedoc 0.19.0 (#1166)
1 parent 9585775 commit 93362d5

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

docgen/generate-docs.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ const contentPath = path.resolve(`${__dirname}/content-sources/node`);
4646
const tempHomePath = path.resolve(`${contentPath}/HOME_TEMP.md`);
4747
const devsitePath = `/docs/reference/admin/node/`;
4848

49-
const firestoreExcludes = ['v1', 'v1beta1', 'setLogFunction','DocumentData'];
49+
const firestoreExcludes = [
50+
'v1', 'v1beta1', 'setLogFunction','DocumentData',
51+
'BulkWriterOptions', 'DocumentChangeType', 'FirestoreDataConverter',
52+
'GrpcStatus', 'Precondition', 'ReadOptions', 'UpdateData', 'Settings',
53+
];
5054
const firestoreHtmlPath = `${docPath}/admin.firestore.html`;
5155
const firestoreHeader = `<section class="tsd-panel-group tsd-member-group ">
5256
<h2>Type aliases</h2>
@@ -278,6 +282,18 @@ function updateHtml(htmlPath, contentBlock) {
278282
const dom = new jsdom.JSDOM(fs.readFileSync(htmlPath));
279283
const contentNode = dom.window.document.body.querySelector('.col-12');
280284

285+
// Recent versions of Typedoc generates an additional index section and a variables
286+
// section for namespaces with re-exports. We iterate through these nodes and remove
287+
// them from the output.
288+
const sections = [];
289+
contentNode.childNodes.forEach((child) => {
290+
if (child.nodeName === 'SECTION') {
291+
sections.push(child);
292+
}
293+
});
294+
contentNode.removeChild(sections[1]);
295+
contentNode.removeChild(sections[2]);
296+
281297
const newSection = new jsdom.JSDOM(contentBlock);
282298
contentNode.appendChild(newSection.window.document.body.firstChild);
283299
fs.writeFileSync(htmlPath, dom.window.document.documentElement.outerHTML);

0 commit comments

Comments
 (0)