-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
autogen.py
50 lines (40 loc) · 1.38 KB
/
autogen.py
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
# -*- coding: utf-8 -*-
import pathlib
import shutil
import keras_autodoc
PAGES = {
'documentation/comparator.md': [
'teller.Comparator',
'teller.Comparator.summary',
],
'documentation/explainer.md': [
'teller.Explainer',
'teller.Explainer.fit',
'teller.Explainer.summary',
],
'documentation/prediction_interval.md': [
'teller.PredictionInterval',
'teller.PredictionInterval.fit',
'teller.PredictionInterval.predict',
]
}
teller_dir = pathlib.Path(__file__).resolve().parents[1]
def generate(dest_dir):
template_dir = teller_dir / 'docs' / 'templates'
doc_generator = keras_autodoc.DocumentationGenerator(
PAGES,
'https://github.com/Techtonique/teller/blob/master',
template_dir,
#teller_dir / 'examples'
)
doc_generator.generate(dest_dir)
readme = (teller_dir / 'README.md').read_text()
index = (template_dir / 'index.md').read_text()
index = index.replace('{{autogenerated}}', readme[readme.find('##'):])
(dest_dir / 'index.md').write_text(index, encoding='utf-8')
shutil.copyfile(teller_dir / 'CONTRIBUTING.md',
dest_dir / 'contributing.md')
#shutil.copyfile(teller_dir / 'docs' / 'extra.css',
# dest_dir / 'extra.css')
if __name__ == '__main__':
generate(teller_dir / 'docs' / 'sources')