Skip to content

Commit 7d8ea9b

Browse files
committed
pythongh-126609: docs: revert changes made to the internal structure of availability directive
In python#125082.
1 parent 5ab9604 commit 7d8ea9b

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

Doc/tools/extensions/availability.py

+6-14
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,12 @@ class Availability(SphinxDirective):
5555
final_argument_whitespace = True
5656

5757
def run(self) -> list[nodes.container]:
58-
title = "Availability"
59-
refnode = addnodes.pending_xref(
60-
title,
61-
nodes.inline(title, title, classes=["xref", "std", "std-ref"]),
62-
refdoc=self.env.docname,
63-
refdomain="std",
64-
refexplicit=True,
65-
reftarget="availability",
66-
reftype="ref",
67-
refwarn=True,
68-
)
69-
sep = nodes.Text(": ")
70-
parsed, msgs = self.state.inline_text(self.arguments[0], self.lineno)
71-
pnode = nodes.paragraph(title, "", refnode, sep, *parsed, *msgs)
58+
availability_ref = ':ref:`Availability <availability>`: '
59+
avail_nodes, avail_msgs = self.state.inline_text(
60+
availability_ref + self.arguments[0],
61+
self.lineno)
62+
pnode = nodes.paragraph(availability_ref + self.arguments[0],
63+
'', *avail_nodes, *avail_msgs)
7264
self.set_source_info(pnode)
7365
cnode = nodes.container("", pnode, classes=["availability"])
7466
self.set_source_info(cnode)

0 commit comments

Comments
 (0)