Subject: Re: [PATCH net-next v1 2/3] doc: netlink: Add hyperlinks to generated Netlink docs

From: Breno Leitao <[email-masked]>
Date: Thu, 28 Mar 2024 08:00:13 -0700

Hi Donald,

On Tue, Mar 26, 2024 at 08:13:10PM +0000, Donald Hunter wrote:
> Update ynl-gen-rst to generate hyperlinks to definitions, attribute
> sets and sub-messages from all the places that reference them.
> 
> Note that there is a single label namespace for all of the kernel docs.
> Hyperlinks within a single netlink doc need to be qualified by the
> family name to avoid collisions.
> 
> The label format is 'family-type-name' which gives, for example,
> 'rt-link-attribute-set-link-attrs' as the link id.
> 
> Signed-off-by: Donald Hunter <[email-masked]>
> ---
>  tools/net/ynl/ynl-gen-rst.py | 44 +++++++++++++++++++++++++++---------
>  1 file changed, 33 insertions(+), 11 deletions(-)
> 
> diff --git a/tools/net/ynl/ynl-gen-rst.py b/tools/net/ynl/ynl-gen-rst.py
> index 5825a8b3bfb4..4be931c9bdbf 100755
> --- a/tools/net/ynl/ynl-gen-rst.py
> +++ b/tools/net/ynl/ynl-gen-rst.py
> @@ -82,9 +82,9 @@ def rst_subsubsection(title: str) -> str:
>      return f"{title}\n" + "~" * len(title)
>  
>  
> -def rst_section(title: str) -> str:
> +def rst_section(prefix: str, title: str) -> str:
>      """Add a section to the document"""
> -    return f"\n{title}\n" + "=" * len(title)
> +    return f".. _{family}-{prefix}-{title}:\n\n{title}\n" + "=" * len(title)

Where is 'family' variable set? Is this a global variable somewhere?