Merge pull request #10377 from kuangp/fix/techdocs-readme

fix(README): do not copy docs/README.md as docs/index.md
This commit is contained in:
Eric Peterson
2022-04-05 18:03:35 +02:00
committed by GitHub
9 changed files with 72 additions and 1 deletions
@@ -42,6 +42,7 @@ export default async function generate(cmd: Command) {
const omitTechdocsCorePlugin = cmd.omitTechdocsCoreMkdocsPlugin;
const dockerImage = cmd.dockerImage;
const pullImage = cmd.pull;
const legacyCopyReadmeMdToIndexMd = cmd.legacyCopyReadmeMdToIndexMd;
logger.info(`Using source dir ${sourceDir}`);
logger.info(`Will output generated files in ${outputDir}`);
@@ -56,6 +57,7 @@ export default async function generate(cmd: Command) {
runIn: cmd.docker ? 'docker' : 'local',
dockerImage,
pullImage,
legacyCopyReadmeMdToIndexMd,
mkdocs: {
omitTechdocsCorePlugin,
},
@@ -59,6 +59,11 @@ export function registerCommands(program: CommanderStatic) {
"Don't patch MkDocs file automatically with techdocs-core plugin.",
false,
)
.option(
'--legacyCopyReadmeMdToIndexMd',
'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,
)
.alias('build')
.action(lazy(() => import('./generate/generate').then(m => m.default)));