-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtypedoc.config.js
60 lines (52 loc) · 2.75 KB
/
typedoc.config.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*!
* -------------------------------------------------------------------------- *
* *
* Kokopu - A JavaScript/TypeScript chess library. *
* <https://www.npmjs.com/package/kokopu> *
* Copyright (C) 2018-2025 Yoann Le Montagner <yo35 -at- melix.net> *
* *
* Kokopu is free software: you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
* as published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version. *
* *
* Kokopu is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General *
* Public License along with this program. If not, see *
* <http://www.gnu.org/licenses/>. *
* *
* -------------------------------------------------------------------------- */
const fs = require('fs');
const path = require('path');
const tmpDir = './build/tmp_docs';
fs.mkdirSync(path.resolve(__dirname, tmpDir), { recursive: true });
// Generate the changelog page.
const changelog = fs.readFileSync(path.resolve(__dirname, './CHANGELOG.md'), { encoding: 'utf8' }).split('\n').splice(2);
changelog.unshift('---', 'title: ChangeLog', '---', '', '# ChangeLog', '', '<div id="changelog">');
changelog.push('</div>');
fs.writeFileSync(path.resolve(__dirname, `${tmpDir}/changelog.md`), changelog.join('\n'));
// TypeDoc config.
module.exports = {
entryPoints: [ './src/index.ts' ],
out: './dist/docs',
readme: './doc_src/home.md',
favicon: './doc_src/kokopu-favicon.png',
customCss: './doc_src/style.css',
excludePrivate: true,
includeVersion: true,
disableSources: true,
footerDate: true,
name: 'Kokopu',
plugin: [ 'typedoc-plugin-extras' ],
customTitle: 'Kokopu documentation',
alwaysCreateEntryPointModule: false,
projectDocuments: [
`${tmpDir}/changelog.md`,
'./doc_src/migration.md',
'./doc_src/tutorials.md',
],
};