diff --git a/docs/README.md b/docs/README.md index 528822e8..66092dd0 100644 --- a/docs/README.md +++ b/docs/README.md @@ -7,6 +7,8 @@ Documentation is currently built using Python 3.11, though it should work fine w ## Running locally +One way is to just run `serve.sh`. Alternatively, the manual steps are: + ```bash # Change directories to the documentation. cd docs/ diff --git a/docs/serve.sh b/docs/serve.sh new file mode 100755 index 00000000..ad833056 --- /dev/null +++ b/docs/serve.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -e + +VENV_PATH="./venv/" +PYTHON_CMD=${1:-python} + +if [ ! -d $VENV_PATH ]; then + echo "venv not found, creating one using the command '${PYTHON_CMD}'..."; + $PYTHON_CMD -m venv venv; + source ./venv/bin/activate; + pip install --upgrade pip; + pip install -r requirements.txt; + ./venv/bin/mkdocs serve; +else + echo "venv already found."; + source ./venv/bin/activate; + ./venv/bin/mkdocs serve; +fi; +