-
Notifications
You must be signed in to change notification settings - Fork 2
/
makedocs.py
executable file
·49 lines (42 loc) · 1.08 KB
/
makedocs.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import warnings
try:
from sh import pdoc
isPdoc = True
except ImportError:
warnings.warn("Run: pip install --user pdoc")
isPdoc = False
pydocs = os.path.join(os.path.realpath(os.path.dirname(__file__)), 'pydocs')
if not os.path.isdir(pydocs):
os.makedirs(pydocs)
pdoc(
'feaLab',
_cwd=pydocs,
html=False,
all_submodules=True,
external_links=True,
overwrite=True,
)
pydocs = os.path.join(os.path.realpath(os.path.dirname(__file__)), 'docs', 'pydocs')
if not os.path.isdir(pydocs):
os.makedirs(pydocs)
pdoc(
'feaLab',
_cwd=pydocs,
html=True,
all_submodules=True,
external_links=True,
overwrite=True,
)
try:
from sh import pandoc
isPandoc = True
except ImportError:
warnings.warn("Run: brew install pandoc")
isPandoc = False
if isPandoc:
readmepath = os.path.join(os.path.realpath(os.path.dirname(__file__)), 'README.md')
if os.path.exists(readmepath):
long_description = pandoc(readmepath, read='markdown', write='html', output='docs/index.html')