2020-05-24 19:40:43 +08:00
|
|
|
# serve the site locally
|
2020-05-24 19:03:04 +08:00
|
|
|
serve: prepare_files
|
|
|
|
venv/bin/mkdocs serve
|
|
|
|
|
2020-08-13 19:35:05 +08:00
|
|
|
build: prepare_files
|
|
|
|
venv/bin/mkdocs build
|
|
|
|
|
2020-05-24 19:40:43 +08:00
|
|
|
# create files that are not versioned inside the mkdocs folder
|
|
|
|
prepare_files: clean
|
2020-05-24 19:03:04 +08:00
|
|
|
# create subfolders
|
2021-12-29 20:41:01 +08:00
|
|
|
mkdir docs/examples
|
2020-05-24 19:03:04 +08:00
|
|
|
# copy images
|
2021-12-29 20:41:01 +08:00
|
|
|
cp -vr ../json.gif docs/images
|
2020-05-24 19:03:04 +08:00
|
|
|
# copy examples
|
|
|
|
cp -vr ../examples/*.cpp ../examples/*.output docs/examples
|
|
|
|
|
2020-05-24 19:40:43 +08:00
|
|
|
# clean subfolders
|
|
|
|
clean:
|
2021-12-29 20:41:01 +08:00
|
|
|
rm -fr docs/images/json.gif docs/examples
|
2020-05-24 19:40:43 +08:00
|
|
|
|
|
|
|
# publish site to GitHub pages
|
2020-05-24 19:03:04 +08:00
|
|
|
publish: prepare_files
|
|
|
|
venv/bin/mkdocs gh-deploy --clean --force
|
|
|
|
|
2020-05-24 19:40:43 +08:00
|
|
|
# install a Python virtual environment
|
|
|
|
install_venv: requirements.txt
|
2020-05-24 19:03:04 +08:00
|
|
|
python3 -mvenv venv
|
2021-12-29 20:41:01 +08:00
|
|
|
venv/bin/pip install wheel
|
2020-05-24 19:03:04 +08:00
|
|
|
venv/bin/pip install -r requirements.txt
|
|
|
|
|
2020-05-24 19:40:43 +08:00
|
|
|
# uninstall the virtual environment
|
|
|
|
uninstall_venv: clean
|
2020-05-24 19:03:04 +08:00
|
|
|
rm -fr venv
|