Commits

Anonymous committed 1cdf6e0

Move jinja external to svn.python.org, extend Makefile.

  • Participants
  • Parent commits 1b554dc

Comments (0)

Files changed (4)

 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 
-PYTHON  = python
-SVNROOT = http://svn.python.org/projects
+# You can set these variables from the command line.
+PYTHON       ?= python
+SVNROOT      ?= http://svn.python.org/projects
+SPHINXOPTS   ?=
 
-.PHONY: help checkout html web htmlhelp clean
+ALLSPHINXOPTS = -b$(BUILDER) -dbuild/doctrees $(SPHINXOPTS) . build/$(BUILDER)
+
+.PHONY: help checkout update build html web htmlhelp clean
 
 help:
 	@echo "Please use \`make <target>' where <target> is one of"
 	svn update tools/docutils
 	svn update tools/pygments
 
-html: checkout
-	mkdir -p build/html build/doctrees
-	$(PYTHON) tools/sphinx-build.py -bhtml -dbuild/doctrees . build/html
+build: checkout
+	mkdir -p build/$(BUILDER) build/doctrees
+	$(PYTHON) tools/sphinx-build.py $(ALLSPHINXOPTS)
 	@echo
+
+html: BUILDER = html
+html: build
 	@echo "Build finished. The HTML pages are in build/html."
 
-web: checkout
-	mkdir -p build/web build/doctrees
-	$(PYTHON) tools/sphinx-build.py -bweb -dbuild/doctrees . build/web
-	@echo
+web: BUILDER = web
+web: build
 	@echo "Build finished; now you can run"
 	@echo "  PYTHONPATH=tools $(PYTHON) -m sphinx.web build/web"
 	@echo "to start the server."
 
-htmlhelp: checkout
-	mkdir -p build/hhp build/doctrees
-	$(PYTHON) tools/sphinx-build.py -bhtmlhelp -dbuild/doctrees . build/hhp
-	@echo
+htmlhelp: BUILDER = htmlhelp
+htmlhelp: build
 	@echo "Build finished; now you can run HTML Help Workshop with the" \
 	      "build/hhp/pydoc.hhp project file."
 

Doc-26/README.txt

 You need to install Python 2.5 or higher; the toolset used to build the docs are
 written in Python.  The toolset used to build the documentation is called
 *Sphinx*, it is not included in this tree, but maintained separately in the
-Python Subversion repository.  Also needed are Jinja, a templating engine, and
-optionally Pygments, a code highlighter.
+Python Subversion repository.  Also needed are Jinja, a templating engine
+(included in Sphinx as a Subversion external), and optionally Pygments, a code
+highlighter.
 
 
 Using make
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 
-PYTHON  = python
-SVNROOT = http://svn.python.org/projects
+# You can set these variables from the command line.
+PYTHON       ?= python
+SVNROOT      ?= http://svn.python.org/projects
+SPHINXOPTS   ?=
 
-.PHONY: help checkout html web htmlhelp clean
+ALLSPHINXOPTS = -b$(BUILDER) -dbuild/doctrees $(SPHINXOPTS) . build/$(BUILDER)
+
+.PHONY: help checkout update build html web htmlhelp clean
 
 help:
 	@echo "Please use \`make <target>' where <target> is one of"
 	svn update tools/docutils
 	svn update tools/pygments
 
-html: checkout
-	mkdir -p build/html build/doctrees
-	$(PYTHON) tools/sphinx-build.py -bhtml -dbuild/doctrees . build/html
+build: checkout
+	mkdir -p build/$(BUILDER) build/doctrees
+	$(PYTHON) tools/sphinx-build.py $(ALLSPHINXOPTS)
 	@echo
+
+html: BUILDER = html
+html: build
 	@echo "Build finished. The HTML pages are in build/html."
 
-web: checkout
-	mkdir -p build/web build/doctrees
-	$(PYTHON) tools/sphinx-build.py -bweb -dbuild/doctrees . build/web
-	@echo
+web: BUILDER = web
+web: build
 	@echo "Build finished; now you can run"
 	@echo "  PYTHONPATH=tools $(PYTHON) -m sphinx.web build/web"
 	@echo "to start the server."
 
-htmlhelp: checkout
-	mkdir -p build/hhp build/doctrees
-	$(PYTHON) tools/sphinx-build.py -bhtmlhelp -dbuild/doctrees . build/hhp
-	@echo
+htmlhelp: BUILDER = htmlhelp
+htmlhelp: build
 	@echo "Build finished; now you can run HTML Help Workshop with the" \
 	      "build/hhp/pydoc.hhp project file."
 

Doc-3k/README.txt

 You need to install Python 2.5 or higher; the toolset used to build the docs are
 written in Python.  The toolset used to build the documentation is called
 *Sphinx*, it is not included in this tree, but maintained separately in the
-Python Subversion repository.  Also needed are Jinja, a templating engine, and
-optionally Pygments, a code highlighter.
+Python Subversion repository.  Also needed are Jinja, a templating engine
+(included in Sphinx as a Subversion external), and optionally Pygments, a code
+highlighter.
 
 
 Using make