Skip to content
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
Next Next commit
Don't parse content as arg in the impl-detail directive
This does not change the (untranslated) output,
but ensures that the doctree node metadata is correct.
which fixes gh-97607 with the text not being translated.
It also simplifies the code and logic
and makes it consistant with the docutils built-in directives.
  • Loading branch information
CAM-Gerlach committed Sep 29, 2022
commit 00e5bccceff33538c852c69c0e7af9eec4e5f705
5 changes: 0 additions & 5 deletions Doc/tools/extensions/pyspecific.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ def source_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
class ImplementationDetail(Directive):

has_content = True
required_arguments = 0
optional_arguments = 1
final_argument_whitespace = True

# This text is copied to templates/dummy.html
Expand All @@ -112,9 +110,6 @@ def run(self):
label = translators['sphinx'].gettext(self.label_text)
content = self.content
add_text = nodes.strong(label, label)
if self.arguments:
n, m = self.state.inline_text(self.arguments[0], self.lineno)
pnode.append(nodes.paragraph('', '', *(n + m)))
self.state.nested_parse(content, self.content_offset, pnode)
if pnode.children and isinstance(pnode[0], nodes.paragraph):
content = nodes.inline(pnode[0].rawsource, translatable=True)
Expand Down