mirror of
https://github.com/ClementTsang/bottom
synced 2024-11-14 00:17:07 +00:00
docs: add script to serve mkdocs locally
This commit is contained in:
parent
bce95c0d48
commit
9ed5df15bb
2 changed files with 22 additions and 0 deletions
|
@ -7,6 +7,8 @@ Documentation is currently built using Python 3.11, though it should work fine w
|
||||||
|
|
||||||
## Running locally
|
## Running locally
|
||||||
|
|
||||||
|
One way is to just run `serve.sh`. Alternatively, the manual steps are:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Change directories to the documentation.
|
# Change directories to the documentation.
|
||||||
cd docs/
|
cd docs/
|
||||||
|
|
20
docs/serve.sh
Executable file
20
docs/serve.sh
Executable 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;
|
||||||
|
|
Loading…
Reference in a new issue