summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2014-12-08 01:34:03 +0200
committerTim Graham <timograham@gmail.com>2014-12-08 07:24:07 -0500
commitb249d4dcc780a99e1cfc8d1ef09f6643e7262350 (patch)
treec7d86a28f9cf6fa33d87038e65e4ad4ca3071937
parent614cbf1c3c5010d0180deac6d335b37d174c89ec (diff)
[1.7.x] 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 Doc/Makefile. Backport of b327a614eb7d885441c6a2575e10b70ac1352aae from master
-rw-r--r--docs/Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/Makefile b/docs/Makefile
index f2502be3a7..f57db99699 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 ?=
@@ -15,11 +16,12 @@ ALLSPHINXOPTS = -n -d $(BUILDDIR)/doctrees -D language=$(LANGUAGE) $(PAPEROPT_
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-.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"
@@ -48,6 +50,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