Skip to content

Commit df59d2f

Browse files
scripts for generating docs
1 parent 3aab1ad commit df59d2f

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ node_modules
44
tmp
55
proto
66
weights_uncompressed
7-
weights_unused
7+
weights_unused
8+
docs

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ weights
77
weights_uncompressed
88
weights_unused
99
test
10-
tools
10+
tools
11+
docs

typedoc.config.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
const path = require('path')
2+
const fs = require('fs')
3+
4+
const excludes = [
5+
{ dir: 'faceLandmarkNet', exceptions: ['index.ts', 'FaceLandmark68Net.ts', 'FaceLandmark68TinyNet.ts'] },
6+
{ dir: 'faceRecognitionNet', exceptions: ['index.ts', 'FaceRecognitionNet.ts'] },
7+
{ dir: 'mtcnn', exceptions: ['index.ts', 'Mtcnn.ts', 'MtcnnOptions.ts'] },
8+
{ dir: 'ssdMobilenetv1', exceptions: ['index.ts', 'SsdMobilenetv1.ts', 'SsdMobilenetv1Options.ts'] },
9+
{ dir: 'tinyFaceDetector', exceptions: ['index.ts', 'TinyFaceDetector.ts', 'TinyFaceDetectorOptions.ts'] },
10+
{ dir: 'tinyYolov2', exceptions: ['index.ts', 'TinyYolov2.ts'] }
11+
]
12+
13+
const exclude = excludes.map(({ dir, exceptions }) => {
14+
const files = fs.readdirSync(path.resolve('src', dir))
15+
.filter(file => !exceptions.some(ex => ex === file))
16+
17+
return files.map(file => `**/${dir}/${file}`)
18+
}).reduce((flat, arr) => flat.concat(arr), [])
19+
20+
module.exports = {
21+
mode: 'file',
22+
out: 'docs',
23+
module: 'commonjs',
24+
target: 'es5',
25+
theme: 'default',
26+
excludeExternals: true,
27+
includeDeclarations: true,
28+
excludePrivate: true,
29+
excludeNotExported: true,
30+
stripInternal: true,
31+
externalPattern: 'node_modules/@tensorflow',
32+
exclude
33+
}

0 commit comments

Comments
 (0)