#!/bin/bash
#
# The script expects to be run from the TOP-LEVEL folder of tmlibrary
#

# exit at the first error
set -e

# Checks if we are in the top level folder
if [[ ! -d src ]] || [[ ! -d docs ]] || [[ ! -d scripts ]]; then
    echo "Please execute script from the top-level folder of tmlibrary"
    exit 100
fi

VENV="${PWD}/venv_tmlibrary"

# Activate virtual environment
source $VENV/bin/activate

# Generates docs
make -C docs html

# Deactivate virtual environment
deactivate

#!/bin/bash
#
# The script expects to be run from the TOP-LEVEL folder of tmlibrary
#

# exit at the first error
set -e

# Checks if we are in the top level folder
if [[ ! -d src ]] || [[ ! -d docs ]] || [[ ! -d scripts ]]; then
    echo "Please execute script from the top-level folder of tmlibrary"
    exit 100
fi

# Activate environment created by test_all_packages script.
workon tmlibrary

# Generates docs.
sphinx-apidoc -o docs src/tmlib
make -C docs html

# Deactivate virtual environment
deactivate tmlibrary

--- 
+++ 
@@ -12,12 +12,13 @@
     exit 100
 fi
 
-# Activate environment created by test_all_packages script.
-workon tmlibrary
+VENV="${PWD}/venv_tmlibrary"
 
-# Generates docs.
-sphinx-apidoc -o docs src/tmlib
+# Activate virtual environment
+source $VENV/bin/activate
+
+# Generates docs
 make -C docs html
 
 # Deactivate virtual environment
-deactivate tmlibrary
+deactivate
Add script to build documentation on jenkins
