Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build process notes to README.rst #2016

Merged
merged 5 commits into from
Jun 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,60 @@ rendering pipeline:
local clone of the PEP repository
* Run ``./manage.py generate_pep_pages`` as described in
https://pythondotorg.readthedocs.io/pep_generation.html


Rendering PEPs with Sphinx
==========================

There is a Sphinx-rendered version of the PEPs at https://python.github.io/peps/
(updated on every push to ``master``)

**Warning:** This version is not, and should not be taken to be, a canonical
source for PEPs whilst it remains in preview (`please report any rendering bugs
<https://github.com/python/peps/issues/new>`_). The canonical source for PEPs remains
https://www.python.org/dev/peps/

Build PEPs with Sphinx locally:
-------------------------------

1. Ensure you have Python >=3.9 and Sphinx installed
2. If you have access to ``make``, follow (i), otherwise (ii)

i. Run ``make sphinx-local``
ii. Run ``python build.py -j 8 --build-files``. Note that the jobs argument
only takes effect on unix (non-mac) systems.
3. Wait for Sphinx to render the PEPs. There may be a series of warnings about
unreferenced citations or labels -- whilst these are valid warnings they do
not impact the build process.
4. Navigate to the ``build`` directory of your PEPs repo to find the HTML pages.
AA-Turner marked this conversation as resolved.
Show resolved Hide resolved
PEP 0 provides a formatted index, and may be a useful reference.

Arguments to ``build.py``:
--------------------------

Renderers:

``-f`` or ``--build-files``
Renders PEPs to ``pep-XXXX.html`` files

``-d`` or ``--build-dirs``
Renders PEPs to ``index.html`` files within ``pep-XXXX`` directories

Options:

``-i`` or ``--index-file``
Copies PEP 0 to a base index file

``-j`` or ``--jobs``
How many parallel jobs to run (if supported). Integer, default 1

``-n`` or ``--nitpicky``
Runs Sphinx in `nitpicky` mode

``-w`` or ``--fail-on-warning``
Fails Sphinx on warnings

Tools:

``-l`` or ``--check-links``
Checks validity of links within PEP sources