Skip to content

Commit 8b25956

Browse files
committed
now impl-detail -> admonition directive
1 parent 363f7a5 commit 8b25956

File tree

2 files changed

+2
-31
lines changed

2 files changed

+2
-31
lines changed

pep_sphinx_extensions/__init__.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from typing import TYPE_CHECKING, Any
88

99
from docutils.writers.html5_polyglot import HTMLTranslator
10-
from docutils import nodes
1110
from sphinx import environment
1211

1312
from pep_sphinx_extensions.generate_rss import (
@@ -27,9 +26,6 @@
2726
from pep_sphinx_extensions.pep_processor.transforms import pep_references
2827
from pep_sphinx_extensions.pep_zero_generator.pep_index_generator import create_pep_zero
2928

30-
from sphinx.locale import _ as sphinx_gettext
31-
from sphinx.util.docutils import SphinxDirective
32-
3329
if TYPE_CHECKING:
3430
from sphinx.application import Sphinx
3531

@@ -73,29 +69,6 @@ def set_description(
7369
context["description"] = "Python Enhancement Proposals (PEPs)"
7470

7571

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-
9972
def setup(app: Sphinx) -> dict[str, bool]:
10073
"""Initialize Sphinx extension."""
10174

@@ -128,8 +101,6 @@ def setup(app: Sphinx) -> dict[str, bool]:
128101
app.add_directive("superseded", pep_banner_directive.SupersededBanner)
129102
app.add_directive("withdrawn", pep_banner_directive.WithdrawnBanner)
130103

131-
app.add_directive('impl-detail', ImplementationDetail)
132-
133104
# Register event callbacks
134105
app.connect("builder-inited", _update_config_for_builder) # Update configuration values for builder used
135106
app.connect("env-before-read-docs", create_pep_zero) # PEP 0 hook

peps/pep-0757.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ If :c:member:`PyLongExport.digits` is not ``NULL``, a private field of the
154154
:c:func:`PyLong_FreeExport` must be called when the export is no longer
155155
needed.
156156
157-
.. impl-detail::
157+
.. admonition:: CPython implementation detail
158158
This function always succeeds if *obj* is a Python :class:`int` object
159159
or a subclass.
160160
@@ -167,7 +167,7 @@ a thin wrapper to expose Python :class:`int` internal digits array.
167167
168168
Release the export *export_long* created by :c:func:`PyLong_Export`.
169169
170-
.. impl-detail::
170+
.. admonition:: CPython implementation detail
171171
Calling :c:func:`PyLong_FreeExport` is optional if *export_long->digits*
172172
is ``NULL``.
173173

0 commit comments

Comments
 (0)