[docs] adds a stolen shell script for creating the documentation ...
stolen from https://github.com/bendalab/thunderfish/blob/master/build-docs.sh
This commit is contained in:
parent
b4d03325de
commit
0fcddd3d51
42
build_docu.sh
Executable file
42
build_docu.sh
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
die () { echo "ERROR: $*" >&2; exit 2; }
|
||||
|
||||
for cmd in pdoc3; do
|
||||
command -v "$cmd" >/dev/null ||
|
||||
die "Missing $cmd; \`pip install $cmd\`"
|
||||
done
|
||||
|
||||
PACKAGE="fishbook"
|
||||
PACKAGEROOT="$(dirname "$(realpath "$0")")"
|
||||
BUILDROOT="$PACKAGEROOT/site"
|
||||
|
||||
echo
|
||||
echo "Clean up documentation of $PACKAGE"
|
||||
echo
|
||||
|
||||
rm -rf "$BUILDROOT" 2> /dev/null || true
|
||||
mkdir -p "$BUILDROOT"
|
||||
|
||||
echo "Building general documentation for $PACKAGE"
|
||||
echo
|
||||
|
||||
cd "$PACKAGEROOT"
|
||||
mkdocs build --config-file .mkdocs.yml --site-dir "$BUILDROOT"
|
||||
cd - > /dev/null
|
||||
|
||||
echo
|
||||
echo "Building API reference docs for $PACKAGE"
|
||||
echo
|
||||
|
||||
cd "$PACKAGEROOT"
|
||||
pdoc3 --html --output-dir "$BUILDROOT/api-tmp" $PACKAGE
|
||||
mv "$BUILDROOT/api-tmp/$PACKAGE" "$BUILDROOT/api"
|
||||
rmdir "$BUILDROOT/api-tmp"
|
||||
cd - > /dev/null
|
||||
|
||||
echo
|
||||
echo "Done. Docs in:"
|
||||
echo
|
||||
echo " file://$BUILDROOT/index.html"
|
||||
echo
|
Loading…
Reference in New Issue
Block a user