-
Notifications
You must be signed in to change notification settings - Fork 40
/
gen-doc.js
41 lines (37 loc) · 1.03 KB
/
gen-doc.js
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
/**
* @File : gen-doc.js
* @Author : 瞬光 ([email protected])
* @Date : 1/31/2019, 10:24:56 AM
* @Description:
*/
const typedoc = require('typedoc');
const path = require('path');
const fs = require('fs');
const sources = [
path.resolve(__dirname, './src')
];
const options = {
module: 'commonjs',
target: 'es5',
exclude: '**/node_modules/**/*.*',
experimentalDecorators: true,
excludeExternals: true,
out: path.resolve(__dirname, './demo/assets/documents'),
mode: 'file',
excludePrivate: true,
excludeProtected: true,
tsconfig: path.resolve(__dirname, './src/tsconfig.json'),
// theme: 'markdown',
// mdEngine: 'github',
plugin: [
// require.resolve('typedoc-plugin-markdown'),
// require.resolve('typedoc-plugin-no-inherit'),
// require.resolve('./demo/typedoc-indexes-plugin')
]
};
const typedocApp = new typedoc.Application(options);
const src = typedocApp.expandInputFiles(sources);
const project = typedocApp.convert(src);
if (project) {
typedocApp.generateDocs(project, options.out);
}