#!/bin/bash ########################################################################### # # 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. # # @file document.sh # # @author (last) Peter Lucia # @date (last) 06-Aug-2020 # @author (original) Peter Lucia # @date (original) 01-Apr-2020 # ############################################################################ 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 ../ sphinx-apidoc -o docs/source leahi-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