Merge pull request #18699 from SDA-SE/feat/default-mkdocs-plugins

feat: support custom default plugins for techdocs
This commit is contained in:
Morgan Bentell
2023-08-23 10:58:43 +02:00
committed by GitHub
12 changed files with 100 additions and 14 deletions
+1
View File
@@ -37,6 +37,7 @@ Options:
-v --verbose
--omitTechdocsCoreMkdocsPlugin
--legacyCopyReadmeMdToIndexMd
--defaultPlugin [defaultPlugins...]
-h, --help
```
@@ -47,6 +47,7 @@ export default async function generate(opts: OptionValues) {
const dockerImage = opts.dockerImage;
const pullImage = opts.pull;
const legacyCopyReadmeMdToIndexMd = opts.legacyCopyReadmeMdToIndexMd;
const defaultPlugins = opts.defaultPlugin;
logger.info(`Using source dir ${sourceDir}`);
logger.info(`Will output generated files in ${outputDir}`);
@@ -68,6 +69,7 @@ export default async function generate(opts: OptionValues) {
mkdocs: {
legacyCopyReadmeMdToIndexMd,
omitTechdocsCorePlugin,
defaultPlugins,
},
},
},
@@ -70,6 +70,11 @@ export function registerCommands(program: Command) {
'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.',
false,
)
.option(
'--defaultPlugin [defaultPlugins...]',
'Plugins which should be added automatically to the mkdocs.yaml file',
[],
)
.alias('build')
.action(lazy(() => import('./generate/generate').then(m => m.default)));