From a11641eb1dea9cc77b913487a1c502fa23c43d9d Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Mon, 2 Aug 2021 14:29:42 +0200 Subject: [PATCH] Include the '()' in the links to the libpq functions This is more consistent with the rest of the documentation. --- docs/lib/libpq_docs.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/lib/libpq_docs.py b/docs/lib/libpq_docs.py index 03830fd40..0831b2a56 100644 --- a/docs/lib/libpq_docs.py +++ b/docs/lib/libpq_docs.py @@ -137,10 +137,13 @@ def get_reader(): def pq_role(name, rawtext, text, lineno, inliner, options={}, content=[]): + text = utils.unescape(text) + reader = get_reader() if "(" in text: func, noise = text.split("(", 1) noise = "(" + noise + else: func = text noise = "" @@ -154,7 +157,10 @@ def pq_role(name, rawtext, text, lineno, inliner, options={}, content=[]): prb = inliner.problematic(rawtext, rawtext, msg) return [prb], [msg] - text = utils.unescape(text) + # For a function f(), include the () in the signature for consistency + # with a normal `thing()` + if noise == "()": + func, noise = func + noise, "" the_nodes = [] the_nodes.append(nodes.reference(func, func, refuri=url)) -- 2.47.3