-
-
Notifications
You must be signed in to change notification settings - Fork 66
/
pkg_doc.py
executable file
·45 lines (35 loc) · 1.04 KB
/
pkg_doc.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pyfixdoc
import sys
######################################################################
## main entry point
if __name__ == "__main__":
# NB: `inspect` is picky about paths and current working directory
# this only works if run from the top-level directory of the repo
sys.path.insert(0, "../")
# customize the following, per use case
import kglab
class_list = [
"KnowledgeGraph",
"Subgraph",
"SubgraphMatrix",
"SubgraphTensor",
"Measure",
"Simplex0",
"Simplex1",
"PSLModel",
"GPViz",
]
pkg_doc = pyfixdoc.PackageDoc(
"kglab",
"https://github.com/DerwenAI/kglab/blob/main",
class_list,
)
# NB: uncomment to analyze/troubleshoot the results of `inspect`
#pkg_doc.show_all_elements(); sys.exit(0)
# build the apidocs markdown
pkg_doc.build()
# output the apidocs markdown
ref_md_file = sys.argv[1]
pkg_doc.write_markdown(ref_md_file)