[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD4GDZz+-3=fBqEkMJqORxF=1wwX84aXm3JW=K0tLG2vNF+Vdg@mail.gmail.com>
Date: Thu, 28 Mar 2024 15:54:09 +0000
From: Donald Hunter <donald.hunter@...il.com>
To: Breno Leitao <leitao@...ian.org>
Cc: netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, Jiri Pirko <jiri@...nulli.us>,
Alessandro Marcolini <alessandromarcolini99@...il.com>, donald.hunter@...hat.com
Subject: Re: [PATCH net-next v1 2/3] doc: netlink: Add hyperlinks to generated
Netlink docs
On Thu, 28 Mar 2024 at 15:00, Breno Leitao <leitao@...ian.org> wrote:
>
> 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 <donald.hunter@...il.com>
> > ---
> > 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?
Yes, here in parse_yaml(). I realise it's a bit of a hack but would
like to clean this up as part of switching to using ynl/lib/nlspec.py
for reading the specs, in a separate patchset.
- title = f"Family ``{obj['name']}`` netlink specification"
+ # Save the family for use in ref labels
+ global family
+ family = obj['name']
+
+ title = f"Family ``{family}`` netlink specification"
Powered by blists - more mailing lists