-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathgenerate-md.mjs
More file actions
48 lines (40 loc) · 1.17 KB
/
generate-md.mjs
File metadata and controls
48 lines (40 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { Application } from 'typedoc';
import { rmSync } from 'node:fs';
import webpack from './webpack/package.json' with { type: 'json' };
import { major } from 'semver';
const out = `pages/v${major(webpack.version)}.x`;
const app = await Application.bootstrapWithPlugins({
// Inputs
// `lib` gives us the runtime export surface for the root `webpack` page,
// `types.d.ts` gives us the primary declarations, and the declaration files
// fill in option/config types that are not re-exported through `types.d.ts`.
entryPoints: [
'./webpack/lib',
'./webpack/types.d.ts',
'./webpack/declarations/**/*.d.ts',
],
// Configuration
tsconfig: './tsconfig.typedoc.json',
// Outputs
out,
modulesFileName: 'index',
readme: 'none',
// Plugins
plugin: [
'typedoc-plugin-markdown',
'./plugins/processor.mjs',
'./plugins/theme/index.mjs',
],
theme: 'doc-kit',
router: 'doc-kit',
// Formatting
hideGroupHeadings: true,
hideBreadcrumbs: true,
hidePageHeader: true,
disableSources: true,
});
const project = await app.convert();
if (project) {
rmSync(out, { recursive: true, force: true });
await app.generateOutputs(project);
}