-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkdocs
executable file
·33 lines (33 loc) · 1.08 KB
/
mkdocs
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
#!/bin/bash -x
if [ -d "docs" ];
then rm -rf docs;
fi
mkdir docs
export PYTHONPATH=$PYTHONPATH:"."
gen_doc () {
local module_name="`basename $1 .py`"
local module_path="`dirname $1`"
if [ $module_name = "__init__" ];
then return;
fi
pdoc --html --template-dir templates --html-dir docs $module_path.$module_name
echo "<li><a href=\"./$module_path/$module_name.m.html\">$module_name</a></li>" >>docs/index.html
}
cat templates/header.html >docs/index.html
markdown LICENSE >>docs/index.html
markdown README.md >>docs/index.html
echo "<h1>API Documentation</h1>" >>docs/index.html
echo "<h3>Packages/Modules</h3>" >>docs/index.html
echo "<ul>" >>docs/index.html
package_list=("char_draw dashboard dashboard_cli data_sources")
for package in ${package_list[*]}; do
echo "<li>$package" >>docs/index.html
echo "<ul>" >>docs/index.html
for source_file in $package/*.py;
do gen_doc $source_file;
done
echo "</li>" >>docs/index.html
echo "</ul>" >>docs/index.html
done
echo "</ul>" >>docs/index.html
cat templates/footer.html >>docs/index.html