feat(docutils): add a --no-reference-header option
MODIFY
packages/docutils/lib/cli/command/build.ts
packages/docutils/lib/cli/command/build.ts
@@ -75,6 +75,11 @@ const opts = {
requiresArg: true,
type: 'string',
},
+ 'no-reference-header': {
+ describe: 'Do not add a navigation header for API reference',
+ group: NAME_GROUP_BUILD,
+ type: 'boolean',
+ },
} as const;
opts as Record<string, Options>;

MODIFY
packages/docutils/lib/nav.ts
packages/docutils/lib/nav.ts
@@ -28,6 +28,7 @@ export async function updateNav<S extends string>({
mkdocsYml: mkDocsYmlPath,
packageJson: packageJsonPath,
referenceHeader = <S>DEFAULT_REFERENCE_HEADER,
+ noReferenceHeader = false,
typedocJson: typeDocJsonPath,
dryRun = false,
}: UpdateNavOpts<S> = {}) {
@@ -102,7 +103,7 @@ export async function updateNav<S extends string>({
log.debug('New reference filepaths: %O', newRefFilepaths);
- const navUsesHeaders = !isStringArray(nav);
+ const navUsesHeaders = noReferenceHeader || !isStringArray(nav);
let shouldWriteMkDocsYml = false;
let refFilepaths: string[];
let nonRefFilepaths: string[];
@@ -159,6 +160,10 @@ export interface UpdateNavOpts<S extends string> {
mkdocsYml?: string;
packageJson?: string;
referenceHeader?: S;
+ /**
+ * If `true`, do not add a reference header to `nav` if one does not exist
+ */
+ noReferenceHeader?: boolean;
typedocJson?: string;
dryRun?: boolean;
}

feat(docutils): add a --no-reference-header option