.PHONY: help build html htmlhelp latex text changes linkcheck \
suspicious coverage doctest pydoc-topics htmlview clean dist check serve \
- autobuild-dev autobuild-stable
+ autobuild-dev autobuild-stable venv
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " check to run a check for frequent markup errors"
@echo " serve to serve the documentation on the localhost (8000)"
-build: venv
+build:
-mkdir -p build
# Look first for a Misc/NEWS file (building from a source release tarball
# or old repo) and use that, otherwise look for a Misc/NEWS.d directory
-rm -rf build/* $(VENVDIR)/*
venv:
- @if [ "$(SPHINXBUILD)" == "PATH=$(VENVDIR)/bin:$$PATH sphinx-build" ]; then \
- $(PYTHON) -m venv $(VENVDIR); \
- echo "A virtual environment for Docs has been made in the $(VENVDIR) directory"; \
- $(VENVDIR)/bin/python3 -m pip install Sphinx blurb; \
- fi
+ $(PYTHON) -m venv $(VENVDIR)
+ $(VENVDIR)/bin/python3 -m pip install -U Sphinx blurb
+ @echo "The venv has been created in the $(VENVDIR) directory"
dist:
rm -rf dist
* `Sphinx <https://pypi.org/project/Sphinx/>`_
* `blurb <https://pypi.org/project/blurb/>`_
-You could manually create a virtual environment and install them, but there is
-a ``Makefile`` already set up to do this for you, as long as you have a working
-Python 3 interpreter available.
+The easiest way to install these tools is to create a virtual environment and
+install the tools into there.
Using make
----------
-A Makefile has been prepared so that (on Unix), after you change into the
-``Doc/`` directory you can simply run ::
+To get started on UNIX, you can create a virtual environment with the command ::
+
+ make venv
+
+That will install all the tools necessary to build the documentation. Assuming
+the virtual environment was created in the ``env`` directory (the default;
+configurable with the VENVDIR variable), you can run the following command to
+build the HTML output files::
make html
(configurable with the SPHINXBUILD and BLURB variables).
On Windows, we try to emulate the Makefile as closely as possible with a
-``make.bat`` file.
-
-To use a Python interpreter that's not called ``python3``, use the standard
-way to set Makefile variables, using e.g. ::
-
- make html PYTHON=python
-
-On Windows, set the PYTHON environment variable instead.
-
-To use a specific sphinx-build (something other than ``sphinx-build``), set
-the SPHINXBUILD variable.
+``make.bat`` file. If you need to specify the Python interpreter to use,
+set the PYTHON environment variable instead.
Available make targets are:
Without make
------------
-Install the Sphinx package and its dependencies from PyPI. In this situation,
-you'll have to create a virtual environment manually, and install Sphinx into
-it. Change into the ``Doc`` directory and run ::
+First, install the tool dependencies from PyPI.
+
+Then, from the ``Doc`` directory, run ::
- $ python3 -m venv venv
- $ source venv/bin/activate
- (venv) $ pip install Sphinx
- (venv) $ sphinx-build -b<builder> . build/<builder>
+ sphinx-build -b<builder> . build/<builder>
where ``<builder>`` is one of html, text, latex, or htmlhelp (for explanations
see the make targets above).