Expose doc commands in root makefile and add autobuild

This commit is contained in:
Jonathan Kim 2019-06-14 10:40:27 +01:00
parent 775d2e3523
commit 81cef14353
3 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,4 @@
.PHONY: dev-setup ## Install development dependencies
dev-setup:
pip install -e ".[dev]"
@ -9,3 +10,11 @@ format:
lint:
flake8 graphene_django examples
.PHONY: docs ## Generate docs
docs: dev-setup
cd docs && make install && make html
.PHONY: docs-live ## Generate docs with live reloading
docs-live: dev-setup
cd docs && make install && make livehtml

View File

@ -48,12 +48,20 @@ help:
clean:
rm -rf $(BUILDDIR)/*
.PHONY: install ## to install all documentation related requirements
install:
pip install -r requirements.txt
.PHONY: html
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
.PHONY: livehtml ## to build and serve live-reloading documentation
livehtml:
sphinx-autobuild -b html --watch ../graphene_django $(ALLSPHINXOPTS) $(BUILDDIR)/html
.PHONY: dirhtml
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml

View File

@ -1,3 +1,4 @@
sphinx
Sphinx==1.5.3
sphinx-autobuild==0.7.1
# Docs template
http://graphene-python.org/sphinx_graphene_theme.zip