2019-05-12 22:44:59 +02:00
|
|
|
ESPHOME_PATH = ../esphome
|
2024-05-24 22:14:40 +02:00
|
|
|
ESPHOME_REF = 2024.5.3
|
2024-05-19 01:21:53 +02:00
|
|
|
PAGEFIND_VERSION=1.1.0
|
|
|
|
PAGEFIND=pagefind
|
|
|
|
NET_PAGEFIND=../pagefindbin/pagefind
|
2018-05-13 11:37:02 +02:00
|
|
|
|
2024-05-19 01:21:53 +02:00
|
|
|
.PHONY: html html-strict cleanhtml deploy help live-html live-pagefind Makefile netlify netlify-api api netlify-dependencies svg2png copy-svg2png minify
|
2018-05-13 11:37:02 +02:00
|
|
|
|
2019-02-07 13:54:45 +01:00
|
|
|
html:
|
2019-05-15 10:54:51 +02:00
|
|
|
sphinx-build -M html . _build -j auto -n $(O)
|
2024-05-19 01:21:53 +02:00
|
|
|
${PAGEFIND}
|
|
|
|
|
|
|
|
live-html: html
|
2022-01-25 14:49:20 +01:00
|
|
|
sphinx-autobuild . _build -j auto -n $(O) --host 0.0.0.0
|
2019-05-13 21:51:04 +02:00
|
|
|
|
2024-05-19 01:21:53 +02:00
|
|
|
live-pagefind: html
|
|
|
|
${PAGEFIND} --serve
|
|
|
|
|
2019-05-13 21:51:04 +02:00
|
|
|
html-strict:
|
2019-05-15 10:54:51 +02:00
|
|
|
sphinx-build -M html . _build -W -j auto -n $(O)
|
2024-05-19 01:21:53 +02:00
|
|
|
${PAGEFIND}
|
2018-06-07 19:29:35 +02:00
|
|
|
|
2021-09-13 10:07:32 +02:00
|
|
|
minify:
|
2022-01-17 00:32:10 +01:00
|
|
|
minify _static/webserver-v1.js > _static/webserver-v1.min.js
|
|
|
|
minify _static/webserver-v1.css > _static/webserver-v1.min.css
|
2021-09-13 10:07:32 +02:00
|
|
|
|
2019-02-07 13:54:45 +01:00
|
|
|
cleanhtml:
|
|
|
|
rm -rf "_build/html/*"
|
2018-05-13 11:37:02 +02:00
|
|
|
|
2019-02-07 13:54:45 +01:00
|
|
|
svg2png:
|
|
|
|
python3 svg2png.py
|
2018-06-07 19:29:35 +02:00
|
|
|
|
2019-02-07 13:54:45 +01:00
|
|
|
help:
|
|
|
|
sphinx-build -M help . _build $(O)
|
2018-06-07 19:29:35 +02:00
|
|
|
|
2019-02-07 13:54:45 +01:00
|
|
|
api:
|
|
|
|
mkdir -p _build/html/api
|
2019-05-12 22:44:59 +02:00
|
|
|
@if [ ! -d "$(ESPHOME_PATH)" ]; then \
|
2021-06-16 10:47:49 +02:00
|
|
|
git clone --branch $(ESPHOME_REF) https://github.com/esphome/esphome.git $(ESPHOME_PATH) || \
|
|
|
|
git clone --branch beta https://github.com/esphome/esphome.git $(ESPHOME_PATH); \
|
2019-02-07 13:54:45 +01:00
|
|
|
fi
|
2019-05-12 22:44:59 +02:00
|
|
|
ESPHOME_PATH=$(ESPHOME_PATH) doxygen Doxygen
|
2018-05-14 21:15:49 +02:00
|
|
|
|
2024-05-19 01:21:53 +02:00
|
|
|
net-html:
|
|
|
|
sphinx-build -M html . _build -j auto -n $(O)
|
|
|
|
${NET_PAGEFIND}
|
|
|
|
|
2019-02-07 13:54:45 +01:00
|
|
|
netlify-api: netlify-dependencies
|
|
|
|
mkdir -p _build/html/api
|
2019-05-12 22:44:59 +02:00
|
|
|
@if [ ! -d "$(ESPHOME_PATH)" ]; then \
|
2021-06-16 10:47:49 +02:00
|
|
|
git clone --branch $(ESPHOME_REF) https://github.com/esphome/esphome.git $(ESPHOME_PATH) || \
|
|
|
|
git clone --branch beta https://github.com/esphome/esphome.git $(ESPHOME_PATH); \
|
2018-08-27 13:21:30 +02:00
|
|
|
fi
|
2019-05-12 22:44:59 +02:00
|
|
|
ESPHOME_PATH=$(ESPHOME_PATH) ../doxybin/doxygen Doxygen
|
2018-08-27 13:21:30 +02:00
|
|
|
|
2024-05-19 01:21:53 +02:00
|
|
|
netlify-dependencies: pagefind-binary
|
2019-02-07 13:54:45 +01:00
|
|
|
mkdir -p ../doxybin
|
|
|
|
curl -L https://github.com/esphome/esphome-docs/releases/download/v1.10.1/doxygen-1.8.13.xz | xz -d >../doxybin/doxygen
|
|
|
|
chmod +x ../doxybin/doxygen
|
2018-11-19 18:32:16 +01:00
|
|
|
|
2024-05-19 01:21:53 +02:00
|
|
|
pagefind-binary:
|
|
|
|
mkdir -p ../pagefindbin
|
|
|
|
curl -o pagefind-v$(PAGEFIND_VERSION)-x86_64-unknown-linux-musl.tar.gz https://github.com/CloudCannon/pagefind/releases/download/v$(PAGEFIND_VERSION)/pagefind-v$(PAGEFIND_VERSION)-x86_64-unknown-linux-musl.tar.gz -L
|
|
|
|
tar xzf pagefind-v$(PAGEFIND_VERSION)-x86_64-unknown-linux-musl.tar.gz
|
|
|
|
rm pagefind-v$(PAGEFIND_VERSION)-x86_64-unknown-linux-musl.tar.gz
|
|
|
|
mv pagefind ${NET_PAGEFIND}
|
|
|
|
|
|
|
|
|
2019-02-07 13:54:45 +01:00
|
|
|
copy-svg2png:
|
|
|
|
cp svg2png/*.png _build/html/_images/
|
|
|
|
|
2024-05-19 01:21:53 +02:00
|
|
|
netlify: netlify-dependencies netlify-api net-html copy-svg2png
|
2018-05-13 11:37:02 +02:00
|
|
|
|
2019-07-03 17:38:04 +02:00
|
|
|
lint: html-strict
|
2022-02-20 10:39:33 +01:00
|
|
|
python3 lint.py
|
2019-07-03 17:38:04 +02:00
|
|
|
|
2018-05-13 11:37:02 +02:00
|
|
|
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
|
|
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
|
|
%: Makefile
|
2019-02-07 13:54:45 +01:00
|
|
|
sphinx-build -M $@ . _build $(O)
|