From f7f02550af516d208d6a2d1beb2bb0cec151daa7 Mon Sep 17 00:00:00 2001 From: Jared Dillard Date: Mon, 24 Aug 2026 16:12:04 -0700 Subject: [PATCH] Clarify the add_object_type parse_node callback signature --- sphinx/application.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sphinx/application.py b/sphinx/application.py index 5349c36ad42..09256b5c09e 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -1275,12 +1275,13 @@ def add_object_type( interpreted. - Create a new role (called *rolename*) to cross-reference to these object descriptions. - - If you provide *parse_node*, it must be a function that takes a - string and a docutils node, and it must populate the node with - children parsed from the string. It must then return the name of the - item to be used in cross-referencing and index entries. See the - :file:`conf.py` file in the source for this documentation for an - example. + - If you provide *parse_node*, it must be a function with the signature + ``parse_node(env, sig, signode) -> str``. *env* is the current + build environment, *sig* is the signature string, and *signode* is + the signature node. The function must populate *signode* with + children parsed from *sig* and return the name of the item to be used + in cross-referencing and index entries. See the :file:`conf.py` file + in the source for this documentation for an example. - The *objname* (if not given, will default to *directivename*) names the type of object. It is used when listing objects, e.g. in search results.