aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-01-09 23:05:04 +0200
committerBerker Peksag <berker.peksag@gmail.com>2015-01-09 23:05:04 +0200
commitc87825b6927f668c75adcdea0687711f97b5dbe7 (patch)
treeb70b89d4104fda1c5e0f77afc29d307d6e130497
parentb63b564e2e2f681014d4e0804a96efc9b550d5ed (diff)
downloadmediagoblin-c87825b6927f668c75adcdea0687711f97b5dbe7.tar.lz
mediagoblin-c87825b6927f668c75adcdea0687711f97b5dbe7.tar.xz
mediagoblin-c87825b6927f668c75adcdea0687711f97b5dbe7.zip
Added an "htmlview" target to open docs after building them.
This is helpful if you build and test documentation updates in your development env. Copied from CPython's and Django's Doc/Makefile.
-rw-r--r--docs/Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/Makefile b/docs/Makefile
index 0b97bf7c..e9ee5af0 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -2,6 +2,7 @@
#
# You can set these variables from the command line.
+PYTHON ?= python
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
@@ -14,11 +15,12 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) sou
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+.PHONY: help clean html htmlview dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
+ @echo " htmlview to open the index page built by the html target in your browser"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@@ -46,6 +48,9 @@ html:
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+htmlview: html
+ $(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')"
+
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo