Add `make docs` and `make checkdocs`

Deleted the "docs for how to build the docs" since this is now just a
simple `make docs`, as for all our projects.
parent e2a4099b
......@@ -9,3 +9,5 @@ package-lock.json
# SSL certificate and key.
.tlscert.pem
.tlskey.pem
.tox
......@@ -21,7 +21,11 @@ lint: node_modules/.uptodate
.PHONY: docs
docs:
cd docs && make livehtml
tox -e py3-docs
.PHONY: checkdocs
checkdocs:
tox -e py3-checkdocs
################################################################################
......
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = HypothesisClient
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
livehtml:
sphinx-autobuild -n -b dirhtml -p 8888 "$(SOURCEDIR)" "$(BUILDDIR)/dirhtml" $(SPHINXOPTS) $(O)
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Building the Docs Locally
=========================
This documentation is hosted on `readthedocs <https://docs.readthedocs.io/>`_,
which is a documentation hosting site based on the
`Sphinx <http://www.sphinx-doc.org/>`_ documentation tool,
which in turn uses the `reStructuredText <http://www.sphinx-doc.org/en/stable/rest.html>`_
markup language.
This section will show you how to build and serve these docs locally, so that
you can make changes to `the documentation source files <https://github.com/hypothesis/client/tree/master/docs>`_
and preview those changes locally before sending a pull request.
You will need:
#. `Git <https://git-scm.com/>`_
#. `Python <https://www.python.org/>`_ 2.7 or 3.4+
#. `Virtualenv <https://virtualenv.pypa.io>`_
#. `Make <https://www.gnu.org/software/make/>`_
Once you've installed those, follow these steps in a terminal window to build
and serve the docs locally:
#. Checkout the https://github.com/hypothesis/client repo and ``cd`` into it:
.. code-block:: sh
git clone https://github.com/hypothesis/client.git
cd client
#. Create and activate a Python virtual environment for the client
documentation:
.. code-block:: sh
virtualenv .venv
source .venv/bin/activate
#. Install the Python modules needed to build and serve the docs:
.. code-block:: sh
pip install -r requirements-dev.in
#. Build and serve the docs:
.. code-block:: sh
make docs
Now open http://localhost:8888 to view your local build of the docs.
As long as ``make docs`` is running the built docs will automatically update
when you save changes to the source files.
If you've closed your terminal window and then you want to build and serve the
docs again in the future, you don't need to install everything again.
You just need to ``cd`` into the ``client`` directory, activate the virtualenv
(``source .venv/bin/activate``) and then run
``make docs``.
For Documenters
===============
This section contains documentation for **documenters** who want to contribute
documentation to the Hypothesis client.
.. toctree::
:maxdepth: 3
buildthedocs
......@@ -15,4 +15,3 @@ It's used by the
publishers/index
developers/index
documenters/index
[tox]
envlist = py3-docs
skipsdist = true
[testenv]
skip_install = true
deps =
{docs,checkdocs}: recommonmark
{docs,checkdocs}: sphinx-autobuild
{docs,checkdocs}: sphinx
{docs,checkdocs}: sphinx_rtd_theme
changedir =
{docs,checkdocs}: docs
commands =
docs: sphinx-autobuild -BqT -b dirhtml -d {envdir}/doctrees . {envdir}/html
checkdocs: sphinx-build -qTWn -b dirhtml -d {envdir}/doctrees . {envdir}/html
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment