-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakedocs.sh
executable file
·44 lines (36 loc) · 1.28 KB
/
makedocs.sh
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
#!/bin/bash
# Build campy's html documentation.
#
# The documentation is autogenerated from the reStructuredText (.rst) files in
# `docs-src/`, which were originally generated with by running `sphinx-apidoc`
# with the `--separate` flag enabled.
#
# Any modifications to the content of the documentation should be done in
# `docs-src`.
#
# This script, which is little more than a wrapper around `make html`, builds
# the generated html and then copies it into the top-level `docs/` folder from
# which Github Pages serves the documentation at https://campy.sredmond.io.
# Print all of the commands that are being run. Helpful for debugging.
set -x
OLD_DIR="$(pwd)"
# Move to the top-level of the project, assuming this script is run from within
# the git tree.
cd "$(git rev-parse --show-toplevel)"
# Descend into docs-src to make the generated html.
cd docs-src
make html
cd ..
# Copy the built html to the docs/ folder.
# NOTE(sredmond): This won't remove old files with obsolete names from the
# docs/ folder, so periodically manually clean the docs/ folder of
# everything and remake.
cp -r docs-src/_build/html/ docs/
# Clean up.
cd docs-src
make clean
cd ..
cd "${OLD_DIR}"
# Stop printing all commands.
# NOTE(sredmond): This doesn't respect the x setting that the shell was using.
set +x