Newer
Older
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
#!/bin/bash
# Regenerate the API documentation for the project.
#
# A handy trick in case we build new modules and need to bring them into the documentation system.
# remove the existing source/api folder
rm -rf source/api
# go into the source folder
pushd source
# for each application we have, run sphinx-apidocs
for dir in ../../apps/cli/*/* ../../shared/* ../../services/*; do
[[ ! $dir =~ .*__pycache__.* ]] && sphinx-apidoc -o api/$(basename $dir) $dir
done
# generate the header for the API index
cat > api/index.rst <<'EOF'
.. Workspaces documentation master file, created by
sphinx-quickstart on Thu Oct 15 14:12:32 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to the Workspaces API documentation!
--------------------------------------------
Hello!
.. toctree::
:maxdepth: 2
EOF
find . -name modules.rst | sed 's|\./api/| |g; s|\.rst||g' >> api/index.rst
cat >> api/index.rst <<EOF
.. note::
If you have any feedback or requests for the documentation, let Nathan know.
EOF
popd