-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypedoc.config.cjs
More file actions
35 lines (30 loc) · 915 Bytes
/
typedoc.config.cjs
File metadata and controls
35 lines (30 loc) · 915 Bytes
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
const url = require('node:url')
const pkg = require('./package.json')
let repoUrl
if (typeof pkg.repository === 'object') {
if (!Object.prototype.hasOwnProperty.call(pkg.repository, 'url'))
throw new Error('URL does not exist in repository section')
repoUrl = pkg.repository.url
}
else {
repoUrl = pkg.repository
}
const parsedUrl = url.parse(repoUrl)
const repository = `https://${parsedUrl.host || ''}${parsedUrl.path || ''}`
const author = pkg.author?.url
/** @type {import('typedoc').TypeDocOptions} */
module.exports = {
entryPoints: ['./src/index.ts', './src/types.ts', './src/errors.ts'],
out: 'docs',
navigationLinks: {
'Source code': repository,
},
includeVersion: true,
plugin: ['typedoc-theme-yaf'],
theme: 'yaf',
externalPattern: ['**/node_modules/**'],
excludeExternals: true,
excludeInternal: true,
}
if (author)
module.exports.navigationLinks.Author = author