Skip to content

Commit f0cc487

Browse files
cmdref.py: Support autoref for 'help <cmd>'
1 parent d86bdaf commit f0cc487

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/util/cmdref.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,12 @@ class CellDomain(CommandDomain):
430430
TagIndex
431431
}
432432

433-
def autoref(name, rawtext, text, lineno, inliner: Inliner,
433+
def autoref(name, rawtext: str, text: str, lineno, inliner: Inliner,
434434
options=None, content=None):
435435
role = 'cell:ref' if text[0] == '$' else 'cmd:ref'
436+
if text.startswith("help ") and text.count(' ') == 1:
437+
_, cmd = text.split(' ', 1)
438+
text = f'{text} <{cmd}>'
436439
return inliner.interpreted(rawtext, text, role, lineno)
437440

438441
def setup(app: Sphinx):

0 commit comments

Comments
 (0)