Re: [PATCH v2] docs: automarkup: Move common logic to add and resolve xref to helper

From: Jonathan Corbet
Date: Mon Apr 14 2025 - 12:08:25 EST


Nícolas F. R. A. Prado <nfraprado@xxxxxxxxxxxxx> writes:

> Several of the markup functions contain the same code, calling into
> sphinx's pending_xref and resolve_xref functions to add and resolve a
> cross-reference, with only a few of the parameters changed (domain,
> reference type, markup content). Move this logic to its own function and
> reuse it in the markup functions.
>
> No functional change.
>
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@xxxxxxxxxxxxx>
> ---
> Changes in v2:
> - Moved repeated "Go through the dance..." comment to the helper
> - Dropped "Return the xref if we got it..." comment as the helper
> returns None in case of failure
> - Link to v1: https://lore.kernel.org/r/20250407-automarkup-resolve-xref-helper-v1-1-9cac06ad580f@xxxxxxxxxxxxx
> ---
> Documentation/sphinx/automarkup.py | 97 ++++++++++----------------------------
> 1 file changed, 24 insertions(+), 73 deletions(-)

Applied, thanks.

jon