From eff422b5e95fd8d147e1789dd589029c9dbbe209 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Sat, 21 May 2022 21:14:01 +0100 Subject: [PATCH] Remove special PEP 0 post-processing --- .../pep_processor/transforms/pep_zero.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/pep_sphinx_extensions/pep_processor/transforms/pep_zero.py b/pep_sphinx_extensions/pep_processor/transforms/pep_zero.py index 6673f11ece3d..2d8c7ef6f445 100644 --- a/pep_sphinx_extensions/pep_processor/transforms/pep_zero.py +++ b/pep_sphinx_extensions/pep_processor/transforms/pep_zero.py @@ -29,7 +29,6 @@ def __init__(self, document: nodes.document): super().__init__(document) self.pep_table: int = 0 self.entry: int = 0 - self.ref: str | None = None def unknown_visit(self, node: nodes.Node) -> None: """No processing for undefined node types.""" @@ -58,7 +57,6 @@ def visit_colspec(self, node: nodes.colspec) -> None: def visit_row(self, _node: nodes.row) -> None: self.entry = 0 # reset column number - self.ref = None # Reset PEP URL def visit_entry(self, node: nodes.entry) -> None: self.entry += 1 @@ -66,22 +64,6 @@ def visit_entry(self, node: nodes.entry) -> None: return if self.entry == 2 and len(node) == 1: node["classes"].append("num") - # if this is the PEP number column, replace the number with a link to the PEP - para = node[0] - if isinstance(para, nodes.paragraph) and len(para) == 1: - pep_str = para.astext() - try: - pep_num = int(pep_str) - except ValueError: - return - self.ref = self.document.settings.pep_url.format(pep_num) - para[0] = nodes.reference("", pep_str, refuri=self.ref) - elif self.entry == 3 and len(node) == 1 and self.ref: - # If this is the PEP title column, add a link to the PEP - para = node[0] - if isinstance(para, nodes.paragraph) and len(para) == 1: - pep_title = para.astext() - para[0] = nodes.reference("", pep_title, refuri=self.ref) def _mask_email(ref: nodes.reference) -> nodes.reference: