devilbox/docs/Makefile

71 lines
2.2 KiB
Makefile
Raw Normal View History

2019-12-01 12:14:00 +00:00
ifneq (,)
.error This Makefile requires GNU Make.
endif
2018-06-30 15:36:11 +00:00
2019-12-01 12:14:00 +00:00
# -------------------------------------------------------------------------------------------------
# Default configuration
# -------------------------------------------------------------------------------------------------
.PHONY: help build autobuild linkcheck linkcheck2
2018-06-30 15:36:11 +00:00
2019-12-01 12:14:00 +00:00
# -------------------------------------------------------------------------------------------------
# Default Target
# -------------------------------------------------------------------------------------------------
2018-06-30 15:36:11 +00:00
2019-12-01 12:14:00 +00:00
help:
@echo "build Build and test documentation"
@echo "autobuild Continuously run and build (http://0.0.0.0:8000)"
@echo "linkcheck Sphinx linkcheck"
@echo "linkcheck2 Custom linkcheck"
2018-06-30 15:36:11 +00:00
2019-12-01 12:14:00 +00:00
# -------------------------------------------------------------------------------------------------
# Target
# -------------------------------------------------------------------------------------------------
2018-06-30 15:36:11 +00:00
2018-07-25 06:56:45 +00:00
linkcheck2:
2018-07-30 07:32:40 +00:00
ifeq ($(wildcard file1),)
bash -c 'curl -Ss -o linkcheck https://raw.githubusercontent.com/cytopia/linkcheck/master/linkcheck 2>/dev/null'
else
bash -c 'curl -Ss -o linkcheck -z linkcheck https://raw.githubusercontent.com/cytopia/linkcheck/master/linkcheck 2>/dev/null'
endif
chmod +x linkcheck
2019-01-26 16:18:19 +00:00
./linkcheck -l -k -r 60 -t 30 -e rst _includes/
2018-06-30 15:36:11 +00:00
2019-12-01 12:14:00 +00:00
linkcheck:
docker run \
--rm \
$$(tty -s && echo "-it" || echo) \
-e SPHINX_PROJECT="docs" \
-e SPHINX_PORT=8000 \
-e NEW_UID="$$(id -u)" \
-e NEW_GID="$$(id -g)" \
-v $(PWD)/..:/shared/httpd \
devilbox/python-sphinx:3.8-dev \
sphinx-build -M linkcheck . _build
2018-06-30 15:36:11 +00:00
build:
2019-12-01 12:14:00 +00:00
docker run \
--rm \
$$(tty -s && echo "-it" || echo) \
-e SPHINX_PROJECT="docs" \
-e SPHINX_PORT=8000 \
-e NEW_UID="$$(id -u)" \
-e NEW_GID="$$(id -g)" \
-v $(PWD)/..:/shared/httpd \
devilbox/python-sphinx:3.8-dev \
sphinx-build -a -E -n -j auto -W . _build/html
2018-06-30 15:36:11 +00:00
autobuild:
2019-12-01 12:14:00 +00:00
docker run \
--rm \
$$(tty -s && echo "-it" || echo) \
-e SPHINX_PROJECT="docs" \
-e SPHINX_PORT=8000 \
-e NEW_UID="$$(id -u)" \
-e NEW_GID="$$(id -g)" \
-p "8000:8000" \
-v $(PWD)/..:/shared/httpd \
devilbox/python-sphinx:3.8-dev \
sphinx-autobuild -a -E -n -j auto -W -H 0.0.0.0 -p 8000 . _build/html