Skip to content

Commit 191f99e

Browse files
committed
Resolve merge conflicts
2 parents ce13db1 + 5d91953 commit 191f99e

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

docgen/post-process.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ async function fixTitles() {
6363
for (const file of files) {
6464
await fixTitleOf(path.join(markdownDir, file));
6565
}
66+
67+
const tocFile = path.join(markdownDir, 'toc.yaml');
68+
await fixTocTitles(tocFile);
6669
}
6770

6871
async function fixTitleOf(file) {
@@ -92,6 +95,25 @@ async function fixTitleOf(file) {
9295
}
9396
}
9497

98+
async function fixTocTitles(file) {
99+
const reader = readline.createInterface({
100+
input: fs.createReadStream(file),
101+
});
102+
103+
const buffer = [];
104+
for await (let line of reader) {
105+
if (line.includes('- title: firebase-admin.')) {
106+
line = line.replace(/firebase-admin\./, 'firebase-admin/');
107+
}
108+
109+
buffer.push(line);
110+
}
111+
112+
console.log(`Updating titles in ${file}`);
113+
const content = Buffer.from(buffer.join('\r\n'));
114+
await fs.writeFile(file, content);
115+
}
116+
95117
async function getExtraFiles() {
96118
const extrasPath = path.join(__dirname, 'extras');
97119
const files = await fs.readdir(extrasPath);

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020
"test:coverage": "nyc npm run test:unit",
2121
"lint:src": "eslint src/ --ext .ts",
2222
"lint:test": "eslint test/ --ext .ts",
23-
"apidocs": "run-s api-extractor:local api-documenter api-documenter:post",
23+
"apidocs": "run-s api-extractor:local api-documenter api-documenter:toc api-documenter:post",
2424
"api-extractor": "node generate-reports.js",
2525
"api-extractor:local": "npm run build && node generate-reports.js --local",
2626
"esm-wrap": "node generate-esm-wrapper.js",
2727
"api-documenter": "api-documenter-fire markdown --input temp --output docgen/markdown -s",
28+
"api-documenter:toc": "api-documenter-fire toc --input temp --output docgen/markdown -p /docs/reference/admin/node -s",
2829
"api-documenter:post": "node docgen/post-process.js"
2930
},
3031
"nyc": {
@@ -156,7 +157,7 @@
156157
"@google-cloud/storage": "^5.3.0"
157158
},
158159
"devDependencies": {
159-
"@firebase/api-documenter": "^0.1.1",
160+
"@firebase/api-documenter": "^0.1.2",
160161
"@firebase/app": "^0.6.13",
161162
"@firebase/auth": "^0.16.2",
162163
"@firebase/auth-types": "^0.10.1",

0 commit comments

Comments
 (0)