Nest config under mkdocs key.

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
Eric Peterson
2022-04-05 17:33:18 +02:00
parent 9ab9ce617e
commit bcf1a2496c
5 changed files with 21 additions and 15 deletions
@@ -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
```
+6 -6
View File
@@ -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 <docs-dir>/README.md
# or README.md in case a default <docs-dir>/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 <docs-dir>/README.md
# or README.md in case a default <docs-dir>/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,
+11 -6
View File
@@ -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 <docs-dir>/README.md
* or README.md in case a default <docs-dir>/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 <docs-dir>/README.md
* or README.md in case a default <docs-dir>/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;
};
};
/**
@@ -145,7 +145,7 @@ describe('readGeneratorConfig', () => {
runIn: 'docker',
dockerImage: 'my-org/techdocs',
pullImage: false,
legacyCopyReadmeMdToIndexMd: true,
mkdocs: { legacyCopyReadmeMdToIndexMd: true },
},
},
});
@@ -222,7 +222,7 @@ export function readGeneratorConfig(
'techdocs.generator.mkdocs.omitTechdocsCorePlugin',
),
legacyCopyReadmeMdToIndexMd: config.getOptionalBoolean(
'techdocs.generator.legacyCopyReadmeMdToIndexMd',
'techdocs.generator.mkdocs.legacyCopyReadmeMdToIndexMd',
),
};
}