diff --git a/docgen/post-process.js b/docgen/post-process.js index 7366b2a86d..4012797471 100644 --- a/docgen/post-process.js +++ b/docgen/post-process.js @@ -137,7 +137,7 @@ async function readExtraContentFrom(source) { const reader = readline.createInterface({ input: fs.createReadStream(source), }); - const content = ['']; + const content = []; for await (const line of reader) { content.push(line); } @@ -150,11 +150,20 @@ async function writeExtraContentTo(target, extra) { const reader = readline.createInterface({ input: fs.createReadStream(target), }); + + let firstHeadingSeen = false; for await (const line of reader) { - output.push(line); - if (line.startsWith('{% block body %}')) { - output.push(...extra); + // Insert extra content just before the first markdown heading. + if (line.match(/^\#+ /)) { + if (!firstHeadingSeen) { + output.push(...extra); + output.push(''); + } + + firstHeadingSeen = true; } + + output.push(line); } const outputBuffer = Buffer.from(output.join('\r\n')); diff --git a/package.json b/package.json index f82170e2ae..f26c11e9c6 100644 --- a/package.json +++ b/package.json @@ -20,11 +20,12 @@ "test:coverage": "nyc npm run test:unit", "lint:src": "eslint src/ --ext .ts", "lint:test": "eslint test/ --ext .ts", - "apidocs": "run-s api-extractor:local api-documenter api-documenter:toc api-documenter:post", + "apidocs": "run-s api-extractor:local api-documenter", "api-extractor": "node generate-reports.js", "api-extractor:local": "npm run build && node generate-reports.js --local", "esm-wrap": "node generate-esm-wrapper.js", - "api-documenter": "api-documenter-fire markdown --input temp --output docgen/markdown -s", + "api-documenter": "run-s api-documenter:markdown api-documenter:toc api-documenter:post", + "api-documenter:markdown": "api-documenter-fire markdown --input temp --output docgen/markdown -s", "api-documenter:toc": "api-documenter-fire toc --input temp --output docgen/markdown -p /docs/reference/admin/node -s", "api-documenter:post": "node docgen/post-process.js" }, diff --git a/src/app-check/index.ts b/src/app-check/index.ts index 6552d9208d..ef347be57f 100644 --- a/src/app-check/index.ts +++ b/src/app-check/index.ts @@ -42,7 +42,7 @@ import { app } from '../firebase-namespace-api'; * @param app Optional app for which to return the `AppCheck` service. * If not provided, the default `AppCheck` service is returned. * - * @return The default `AppCheck` service if no + * @returns The default `AppCheck` service if no * app is provided, or the `AppCheck` service associated with the provided * app. */ @@ -59,10 +59,10 @@ export namespace appCheck { /** * Creates a new {@link appCheck.AppCheckToken `AppCheckToken`} that can be sent * back to a client. - * + * * @param appId The App ID of the Firebase App the token belongs to. * - * @return A promise that fulfills with a `AppCheckToken`. + * @returns A promise that fulfills with a `AppCheckToken`. */ createToken(appId: string): Promise; @@ -73,7 +73,7 @@ export namespace appCheck { * * @param appCheckToken The App Check token to verify. * - * @return A promise fulfilled with the + * @returns A promise fulfilled with the * token's decoded claims if the App Check token is valid; otherwise, a rejected * promise. */ @@ -146,7 +146,7 @@ export namespace appCheck { app_id: string; [key: string]: any; } - + /** * Interface representing a verified App Check token response. */