From: Daniele Varrazzo Date: Mon, 2 Aug 2021 12:29:42 +0000 (+0200) Subject: Include the '()' in the links to the libpq functions X-Git-Tag: 3.0.dev2~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a11641eb1dea9cc77b913487a1c502fa23c43d9d;p=thirdparty%2Fpsycopg.git Include the '()' in the links to the libpq functions This is more consistent with the rest of the documentation. --- 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))