forked from excaliburjs/Excalibur
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapidocs.js
More file actions
51 lines (45 loc) · 1.32 KB
/
apidocs.js
File metadata and controls
51 lines (45 loc) · 1.32 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
49
50
51
const path = require('path');
const fs = require('fs');
const child_process = require('child_process');
const rimraf = require('rimraf');
const TYPEDOC_CMD = path.join('node_modules', '.bin', 'typedoc');
// allow specifying ts doc page title (typically version)
const title = process.argv[2] || 'Edge';
console.log('Build API documentation: ', title);
console.log('Removing existing docs...');
rimraf.sync('docs/api/');
console.log('Compiling default template (default)...');
try {
if (!fs.existsSync('./typedoc-default-themes/node_modules')) {
child_process.execSync('npm install', {
cwd: './typedoc-default-themes',
stdio: [0, 1, 2]
});
}
} catch (e) {
// fails to execute Linux commands, OK
}
console.log('Executing typedoc...');
child_process.execSync(
TYPEDOC_CMD +
' --name "Excalibur.js ' +
title +
' API Documentation"' +
' --target es5' +
' --experimentalDecorators' +
' --mode modules' +
' --readme src/engine/Docs/Index.md' +
' --includes src/engine/Docs' +
' --out docs/api' +
' --theme typedoc-default-themes/bin/default' +
' --hideGenerator' +
' --excludePrivate' +
' --listInvalidSymbolLinks' +
' --gaID UA-46390208-1' +
' --gaSite excaliburjs.com' +
' --tsconfig src/engine/tsconfig.json' +
' src/engine',
{
stdio: [0, 1, 2]
}
);