Index: tools/document.sh =================================================================== diff -u -r028952270169971af5075574ba7b7b4ba241acd3 -r32e628abcbbd3fd70866505d9f2836a6f732ef06 --- tools/document.sh (.../document.sh) (revision 028952270169971af5075574ba7b7b4ba241acd3) +++ tools/document.sh (.../document.sh) (revision 32e628abcbbd3fd70866505d9f2836a6f732ef06) @@ -1,22 +1,48 @@ #!/bin/bash ########################################################################### # -# Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +# Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. # -# THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN -# WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +# THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN +# WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # -# @file document.sh +# @file document.sh # -# @date 29-Apr-2020 -# @author P. Lucia +# @author (last) Peter Lucia +# @date (last) 06-Aug-2020 +# @author (original) Peter Lucia +# @date (original) 01-Apr-2020 # -# @brief Generates doxygen documentation -# ############################################################################ + +CURR_DIR=$(pwd) +if [[ "$@" == "*--setup*" ]]; then + if [[ $(dpkg-query -W -f='${Status}' python3-sphinx | grep -c "ok installed") -eq 0 ]]; then + echo "Please run the following required packages: " + echo "sudo apt-get install python3-sphinx" + echo "Exiting..." + exit 1 + fi + mkdir -p ../docs/ + cd ../docs/ + + # must be run outside of venv + sphinx-quickstart + + read -p "Press 'Enter' once you have added dialin to the sys path in conf.py..." + source ../venv/bin/activate + pip3 install sphinx + cd $CURR_DIR +fi cd ../ -export PROJECT_DIRECTORY=$(pwd) -rm -rf document/html -doxygen document/Doxyfile -cd html -xdg-open document/index.html +sphinx-apidoc -o docs/source dialin +cd docs/ +if [[ "$@" == "*--clean*" ]]; then + make clean +fi +if [[ "$@" == "*--readme*" ]]; then + m2r ../README.md + mv ../README.rst source/ +fi +make html +xdg-open build/html/index.html