Re: [PATCH v5 03/15] tools: ynl_gen_rst.py: create a top-level reference

Donald Hunter <[email protected]>
Newsgroups dev.linux.lists.lkmm,dev.linux.lists.linux-kernel-mentees,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <[email protected]>
Mauro Carvalho Chehab <[email protected]> writes:

> Currently, rt documents are referred with:
>
> Documentation/userspace-api/netlink/netlink-raw.rst: :doc:`rt-link<../../networking/netlink_spec/rt-link>`
> Documentation/userspace-api/netlink/netlink-raw.rst: :doc:`tc<../../networking/netlink_spec/tc>`
> Documentation/userspace-api/netlink/netlink-raw.rst: :doc:`tc<../../networking/netlink_spec/tc>`
>
> that's hard to maintain, and may break if we change the way
> rst files are generated from yaml. Better to use instead a
> reference for the netlink family.
>
> So, add a netlink-<foo> reference to all generated docs.
>
> Signed-off-by: Mauro Carvalho Chehab <[email protected]>

I would still prefer to see patches 3 and 4 merged since they are part
of the same fix.

> ---
>  tools/net/ynl/pyynl/ynl_gen_rst.py | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tools/net/ynl/pyynl/ynl_gen_rst.py b/tools/net/ynl/pyynl/ynl_gen_rst.py
> index 0cb6348e28d3..7bfb8ceeeefc 100755
> --- a/tools/net/ynl/pyynl/ynl_gen_rst.py
> +++ b/tools/net/ynl/pyynl/ynl_gen_rst.py
> @@ -314,10 +314,11 @@ def parse_yaml(obj: Dict[str, Any]) -> str:
>  
>      # Main header
>  
> -    lines.append(rst_header())
> -
>      family = obj['name']
>  
> +    lines.append(rst_header())
> +    lines.append(rst_label("netlink-" + family))
> +
>      title = f"Family ``{family}`` netlink specification"
>      lines.append(rst_title(title))
>      lines.append(rst_paragraph(".. contents:: :depth: 3\n"))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.