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:
@@ -137,4 +137,24 @@ describe('readGeneratorConfig', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('should read legacyCopyReadmeMdToIndexMd config', () => {
|
||||
const config = new ConfigReader({
|
||||
techdocs: {
|
||||
generator: {
|
||||
runIn: 'docker',
|
||||
dockerImage: 'my-org/techdocs',
|
||||
pullImage: false,
|
||||
legacyCopyReadmeMdToIndexMd: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(readGeneratorConfig(config, logger)).toEqual({
|
||||
runIn: 'docker',
|
||||
dockerImage: 'my-org/techdocs',
|
||||
pullImage: false,
|
||||
legacyCopyReadmeMdToIndexMd: true,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -111,7 +111,10 @@ export class TechdocsGenerator implements GeneratorBase {
|
||||
parsedLocationAnnotation,
|
||||
this.scmIntegrations,
|
||||
);
|
||||
await patchIndexPreBuild({ inputDir, logger: childLogger, docsDir });
|
||||
|
||||
if (this.options.legacyCopyReadmeMdToIndexMd) {
|
||||
await patchIndexPreBuild({ inputDir, logger: childLogger, docsDir });
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.options.omitTechdocsCoreMkdocsPlugin) {
|
||||
@@ -218,5 +221,8 @@ export function readGeneratorConfig(
|
||||
omitTechdocsCoreMkdocsPlugin: config.getOptionalBoolean(
|
||||
'techdocs.generator.mkdocs.omitTechdocsCorePlugin',
|
||||
),
|
||||
legacyCopyReadmeMdToIndexMd: config.getOptionalBoolean(
|
||||
'techdocs.generator.legacyCopyReadmeMdToIndexMd',
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ export type GeneratorConfig = {
|
||||
dockerImage?: string;
|
||||
pullImage?: boolean;
|
||||
omitTechdocsCoreMkdocsPlugin?: boolean;
|
||||
legacyCopyReadmeMdToIndexMd?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user