fix(techdocs): do not copy docs/README.md as docs/index.md

Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
Phil Kuang
2022-04-04 12:54:46 -04:00
parent 6880fbfb32
commit 9ab9ce617e
9 changed files with 66 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)));