json/doc/mkdocs/Makefile

35 lines
900 B
Makefile
Raw Normal View History

2020-05-24 13:40:43 +02:00
# serve the site locally
2020-05-24 13:03:04 +02:00
serve: prepare_files
venv/bin/mkdocs serve
2020-08-13 13:35:05 +02:00
build: prepare_files
venv/bin/mkdocs build
2020-05-24 13:40:43 +02:00
# create files that are not versioned inside the mkdocs folder
prepare_files: clean
2020-05-24 13:03:04 +02:00
# build Doxygen
$(MAKE) -C ..
# create subfolders
mkdir docs/images docs/examples
# copy images
2021-04-28 20:33:05 +02:00
cp -vr ../json.gif ../images/range-begin-end.svg ../images/range-rbegin-rend.svg ../images/callback_events.png ../images/json_syntax_number.png docs/images
2020-05-24 13:03:04 +02:00
# copy examples
cp -vr ../examples/*.cpp ../examples/*.output docs/examples
2020-05-24 13:40:43 +02:00
# clean subfolders
clean:
rm -fr docs/images docs/examples
# publish site to GitHub pages
2020-05-24 13:03:04 +02:00
publish: prepare_files
venv/bin/mkdocs gh-deploy --clean --force
2020-05-24 13:40:43 +02:00
# install a Python virtual environment
install_venv: requirements.txt
2020-05-24 13:03:04 +02:00
python3 -mvenv venv
venv/bin/pip install -r requirements.txt
2020-05-24 13:40:43 +02:00
# uninstall the virtual environment
uninstall_venv: clean
2020-05-24 13:03:04 +02:00
rm -fr venv