esphome-docs/Makefile

50 lines
1.5 KiB
Makefile
Raw Normal View History

2018-05-13 11:37:02 +02:00
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = esphomelib
SOURCEDIR = .
BUILDDIR = _build
ESPHOMELIB_PATH = ../esphomelib
html:
$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
cleanhtml:
rm -rf "$(BUILDDIR)/html/*" _doxyxml/
minifyhtml: html
./minify.sh
2018-05-14 21:15:49 +02:00
doxyg:
ESPHOMELIB_PATH=$(ESPHOMELIB_PATH) doxygen Doxygen
2018-06-04 13:46:40 +02:00
fixdeploy: cleanhtml doxyg html minifyhtml
touch "$(BUILDDIR)/html/.nojekyll"
echo "esphomelib.com" >"$(BUILDDIR)/html/CNAME"
cd "$(BUILDDIR)/html" && git add --all && git commit -m "Deploy to gh-pages"
@printf "Run \033[0;36mcd $(BUILDDIR)/html && git push origin gh-pages\033[0m to deploy\n"
2018-06-03 23:26:30 +02:00
2018-06-04 13:46:40 +02:00
releasedeploy: cleanhtml doxyg html minifyhtml
2018-05-13 11:37:02 +02:00
touch "$(BUILDDIR)/html/.nojekyll"
echo "esphomelib.com" >"$(BUILDDIR)/html/CNAME"
2018-06-04 13:46:40 +02:00
-yes '' | make latexpdf
cp $(BUILDDIR)/latex/$(SPHINXPROJ).pdf $(BUILDDIR)/html/_static/esphomelib.pdf
2018-05-13 11:37:02 +02:00
cd "$(BUILDDIR)/html" && git add --all && git commit -m "Deploy to gh-pages"
@printf "Run \033[0;36mcd $(BUILDDIR)/html && git push origin gh-pages\033[0m to deploy\n"
help:
$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
webserver: html
cd "$(BUILDDIR)/html" && python3 -m http.server
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)