From bcf1a2496c3ab403dc7dec43dfa2547375042b1f Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Tue, 5 Apr 2022 17:33:18 +0200 Subject: [PATCH] Nest config under mkdocs key. Signed-off-by: Eric Peterson --- ...admire.md => techdocs-swift-weeks-admire.md} | 3 ++- docs/features/techdocs/configuration.md | 12 ++++++------ plugins/techdocs-backend/config.d.ts | 17 +++++++++++------ .../src/stages/generate/techdocs.test.ts | 2 +- .../src/stages/generate/techdocs.ts | 2 +- 5 files changed, 21 insertions(+), 15 deletions(-) rename .changeset/{swift-weeks-admire.md => techdocs-swift-weeks-admire.md} (88%) diff --git a/.changeset/swift-weeks-admire.md b/.changeset/techdocs-swift-weeks-admire.md similarity index 88% rename from .changeset/swift-weeks-admire.md rename to .changeset/techdocs-swift-weeks-admire.md index c546cb6834..8a747a8bb3 100644 --- a/.changeset/swift-weeks-admire.md +++ b/.changeset/techdocs-swift-weeks-admire.md @@ -9,5 +9,6 @@ BREAKING: The default Techdocs behavior will no longer attempt to copy `docs/REA ```yaml techdocs: generator: - legacyCopyReadmeMdToIndexMd: true + mkdocs: + legacyCopyReadmeMdToIndexMd: true ``` diff --git a/docs/features/techdocs/configuration.md b/docs/features/techdocs/configuration.md index 4d068f5af3..d14850da77 100644 --- a/docs/features/techdocs/configuration.md +++ b/docs/features/techdocs/configuration.md @@ -42,12 +42,12 @@ techdocs: # Defaults to false, which means that the techdocs-core plugin is always added to the mkdocs file. omitTechdocsCorePlugin: false - # (Optional and not recommended) Configures the techdocs generator to - # attempt to ensure an index.md exists falling back to using /README.md - # or README.md in case a default /index.md is not provided. - # Note that https://www.mkdocs.org/user-guide/configuration/#edit_uri behavior - # will be broken in these scenarios. - legacyCopyReadmeMdToIndexMd: false + # (Optional and not recommended) Configures the techdocs generator to + # attempt to ensure an index.md exists falling back to using /README.md + # or README.md in case a default /index.md is not provided. + # Note that https://www.mkdocs.org/user-guide/configuration/#edit_uri behavior + # will be broken in these scenarios. + legacyCopyReadmeMdToIndexMd: false # techdocs.builder can be either 'local' or 'external. # Using the default build strategy, if builder is set to 'local' and you open a TechDocs page, diff --git a/plugins/techdocs-backend/config.d.ts b/plugins/techdocs-backend/config.d.ts index 4801381b0c..c64a001f5f 100644 --- a/plugins/techdocs-backend/config.d.ts +++ b/plugins/techdocs-backend/config.d.ts @@ -46,13 +46,18 @@ export interface Config { pullImage?: boolean; /** - * (Optional and not recommended) Configures the techdocs generator to - * attempt to ensure an index.md exists falling back to using /README.md - * or README.md in case a default /index.md is not provided. - * Note that https://www.mkdocs.org/user-guide/configuration/#edit_uri behavior - * will be broken in these scenarios. + * Override behavior specific to mkdocs. */ - legacyCopyReadmeMdToIndexMd?: boolean; + mkdocs?: { + /** + * (Optional and not recommended) Configures the techdocs generator to + * attempt to ensure an index.md exists falling back to using /README.md + * or README.md in case a default /index.md is not provided. + * Note that https://www.mkdocs.org/user-guide/configuration/#edit_uri behavior + * will be broken in these scenarios. + */ + legacyCopyReadmeMdToIndexMd?: boolean; + }; }; /** diff --git a/plugins/techdocs-node/src/stages/generate/techdocs.test.ts b/plugins/techdocs-node/src/stages/generate/techdocs.test.ts index 5957b6f99e..11c9ee0135 100644 --- a/plugins/techdocs-node/src/stages/generate/techdocs.test.ts +++ b/plugins/techdocs-node/src/stages/generate/techdocs.test.ts @@ -145,7 +145,7 @@ describe('readGeneratorConfig', () => { runIn: 'docker', dockerImage: 'my-org/techdocs', pullImage: false, - legacyCopyReadmeMdToIndexMd: true, + mkdocs: { legacyCopyReadmeMdToIndexMd: true }, }, }, }); diff --git a/plugins/techdocs-node/src/stages/generate/techdocs.ts b/plugins/techdocs-node/src/stages/generate/techdocs.ts index faa8faa60f..c9e26e9d7a 100644 --- a/plugins/techdocs-node/src/stages/generate/techdocs.ts +++ b/plugins/techdocs-node/src/stages/generate/techdocs.ts @@ -222,7 +222,7 @@ export function readGeneratorConfig( 'techdocs.generator.mkdocs.omitTechdocsCorePlugin', ), legacyCopyReadmeMdToIndexMd: config.getOptionalBoolean( - 'techdocs.generator.legacyCopyReadmeMdToIndexMd', + 'techdocs.generator.mkdocs.legacyCopyReadmeMdToIndexMd', ), }; }