8000 Several PEPs: Use explicit `:pep:` and `:rfc:` roles by AA-Turner · Pull Request #2209 · python/peps · GitHub
[go: up one dir, main page]

Skip to content

Several PEPs: Use explicit :pep: and :rfc: roles #2209

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

Merged
merged 4 commits into from
Jan 21, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Turn off the inliner for PEP and RST references
  • Loading branch information
AA-Turner committed Jan 21, 2022
commit 5e7e3f5ed8f8472cc53b41fa258fd08e97577d56
14 changes: 2 additions & 12 deletions pep_sphinx_extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
0