|
7 | 7 | from typing import TYPE_CHECKING, Any |
8 | 8 |
|
9 | 9 | from docutils.writers.html5_polyglot import HTMLTranslator |
10 | | -from docutils import nodes |
11 | 10 | from sphinx import environment |
12 | 11 |
|
13 | 12 | from pep_sphinx_extensions.generate_rss import ( |
|
27 | 26 | from pep_sphinx_extensions.pep_processor.transforms import pep_references |
28 | 27 | from pep_sphinx_extensions.pep_zero_generator.pep_index_generator import create_pep_zero |
29 | 28 |
|
30 | | -from sphinx.locale import _ as sphinx_gettext |
31 | | -from sphinx.util.docutils import SphinxDirective |
32 | | - |
33 | 29 | if TYPE_CHECKING: |
34 | 30 | from sphinx.application import Sphinx |
35 | 31 |
|
@@ -73,29 +69,6 @@ def set_description( |
73 | 69 | context["description"] = "Python Enhancement Proposals (PEPs)" |
74 | 70 |
|
75 | 71 |
|
76 | | -class ImplementationDetail(SphinxDirective): |
77 | | - |
78 | | - has_content = True |
79 | | - final_argument_whitespace = True |
80 | | - |
81 | | - # This text is copied to templates/dummy.html |
82 | | - label_text = sphinx_gettext('CPython implementation detail:') |
83 | | - |
84 | | - def run(self): |
85 | | - self.assert_has_content() |
86 | | - pnode = nodes.compound(classes=['impl-detail']) |
87 | | - content = self.content |
88 | | - add_text = nodes.strong(self.label_text, self.label_text) |
89 | | - self.state.nested_parse(content, self.content_offset, pnode) |
90 | | - content = nodes.inline(pnode[0].rawsource, translatable=True) |
91 | | - content.source = pnode[0].source |
92 | | - content.line = pnode[0].line |
93 | | - content += pnode[0].children |
94 | | - pnode[0].replace_self(nodes.paragraph( |
95 | | - '', '', add_text, nodes.Text(' '), content, translatable=False)) |
96 | | - return [pnode] |
97 | | - |
98 | | - |
99 | 72 | def setup(app: Sphinx) -> dict[str, bool]: |
100 | 73 | """Initialize Sphinx extension.""" |
101 | 74 |
|
@@ -128,8 +101,6 @@ def setup(app: Sphinx) -> dict[str, bool]: |
128 | 101 | app.add_directive("superseded", pep_banner_directive.SupersededBanner) |
129 | 102 | app.add_directive("withdrawn", pep_banner_directive.WithdrawnBanner) |
130 | 103 |
|
131 | | - app.add_directive('impl-detail', ImplementationDetail) |
132 | | - |
133 | 104 | # Register event callbacks |
134 | 105 | app.connect("builder-inited", _update_config_for_builder) # Update configuration values for builder used |
135 | 106 | app.connect("env-before-read-docs", create_pep_zero) # PEP 0 hook |
|
0 commit comments