-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmkdocs
executable file
·31 lines (31 loc) · 1.07 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
#!/bin/bash -x
rm -rf docs/*
#export PYTHONPATH=$PYTHONPATH:"."
gen_doc () {
local module_name="`basename $1 .py`"
local module_path="`dirname $1`"
if [ $module_name = "__init__" ];
then return;
fi
# pdoc3 --html --template-dir templates --html-dir docs $module_path.$module_name
pdoc3 --html --output-dir docs $module_path.$module_name
echo "<li><a href=\"./$module_path/$module_name.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=("slides_sound")
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