refactor: docs (#10126)

This commit is contained in:
Noel
2024-02-29 04:37:52 +01:00
committed by GitHub
parent 0f9017ef95
commit 18cce83d80
192 changed files with 8116 additions and 6321 deletions

View File

@@ -7,25 +7,24 @@ import packageFile from '../package.json';
import { generateSplitDocumentation } from '../src/index.js';
export interface CLIOptions {
custom: string;
input: string[];
newOutput: string;
output: string;
root: string;
typescript: boolean;
all: boolean;
}
const command = createCommand().version(packageFile.version);
const command = createCommand().version(packageFile.version).option('-A, --all', 'Build all available versions', false);
const program = command.parse(process.argv);
program.opts<CLIOptions>();
const opts = program.opts<CLIOptions>();
console.log('Generating split documentation...');
void generateSplitDocumentation({
fetchPackageVersions: async (_) => {
return ['main'];
},
fetchPackageVersionDocs: async (_, __) => {
return JSON.parse(await readFile(`${process.cwd()}/docs/docs.api.json`, 'utf8'));
},
}).then(() => console.log('Generated split documentation.'));
void generateSplitDocumentation(
opts.all
? {}
: {
fetchPackageVersions: async (_) => {
return ['main'];
},
fetchPackageVersionDocs: async (_, __) => {
return JSON.parse(await readFile(`${process.cwd()}/docs/docs.api.json`, 'utf8'));
},
},
).then(() => console.log('Generated split documentation.'));