From 6aceb6a29786426f0ee60551496d98e1c1b918a3 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Mon, 27 May 2024 16:32:45 +1200 Subject: [PATCH] cmdref.py: Support autoref for 'help ' --- docs/util/cmdref.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/util/cmdref.py b/docs/util/cmdref.py index 6fbd81372..c7bb4e241 100644 --- a/docs/util/cmdref.py +++ b/docs/util/cmdref.py @@ -430,9 +430,12 @@ class CellDomain(CommandDomain): TagIndex } -def autoref(name, rawtext, text, lineno, inliner: Inliner, +def autoref(name, rawtext: str, text: str, lineno, inliner: Inliner, options=None, content=None): role = 'cell:ref' if text[0] == '$' else 'cmd:ref' + if text.startswith("help ") and text.count(' ') == 1: + _, cmd = text.split(' ', 1) + text = f'{text} <{cmd}>' return inliner.interpreted(rawtext, text, role, lineno) def setup(app: Sphinx):