From fb18a0c19ca4c2f554c2ab00efb142e9518a3d3a Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sun, 2 Jan 2022 21:14:11 +0000 Subject: [PATCH] Turn off the inliner for PEP and RST references --- pep_sphinx_extensions/__init__.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/pep_sphinx_extensions/__init__.py b/pep_sphinx_extensions/__init__.py index 5479a1dc1324..d2e201c3df25 100644 --- a/pep_sphinx_extensions/__init__.py +++ b/pep_sphinx_extensions/__init__.py @@ -19,18 +19,8 @@ from sphinx.application import Sphinx # Monkeypatch sphinx.environment.default_settings as Sphinx doesn't allow custom settings or Readers -# These settings should go in docutils.conf, but are overridden here for now so as not to affect -# pep2html.py -environment.default_settings |= { - "pep_references": True, - "rfc_references": True, - "pep_base_url": "", - "pep_file_url_template": "", - "_disable_config": True, # disable using docutils.conf whilst running both PEP generators -} - -# TODO replace all inlined PEP and RFC strings with marked-up roles, disable pep_references and rfc_references and remove this monkey-patch -states.Inliner.pep_reference = lambda s, m, _l: [nodes.reference("", m.group(0), refuri=s.document.settings.pep_url.format(int(m.group("pepnum2"))))] +# This disables reading configuration from docutils.conf so as not to affect pep2html.py +environment.default_settings["_disable_config"] = True def _depart_maths():