docs: add script to serve mkdocs locally

This commit is contained in:
ClementTsang 2023-02-04 04:58:12 -05:00
parent bce95c0d48
commit 9ed5df15bb
No known key found for this signature in database
GPG key ID: DC3B7867D8D97095
2 changed files with 22 additions and 0 deletions

View file

@ -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/

20
docs/serve.sh Executable file
View file

@ -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;