netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Breno Leitao <leitao@debian.org>
Cc: corbet@lwn.net, linux-doc@vger.kernel.org,
	netdev@vger.kernel.org, pabeni@redhat.com, edumazet@google.com
Subject: Re: [PATCH] Documentation: Document the Netlink spec
Date: Mon, 6 Nov 2023 14:51:11 -0800	[thread overview]
Message-ID: <20231106145111.3537538f@kernel.org> (raw)
In-Reply-To: <20231103135622.250314-1-leitao@debian.org>

On Fri,  3 Nov 2023 06:56:22 -0700 Breno Leitao wrote:
> This is a Sphinx extension that parses the Netlink YAML spec files
> (Documentation/netlink/specs/), and generates a rst file to be
> displayed into Documentation pages.
> 
> Create a new Documentation/networking/netlink_spec page, and a sub-page
> for each Netlink spec that needs to be documented, such as ethtool,
> devlink, netdev, etc.
> 
> Create a Sphinx directive extension that reads the YAML spec
> (located under Documentation/netlink/specs), parses it and returns a RST
> string that is inserted where the Sphinx directive was called.

> +=======================================
> +Family ``fou`` netlink specification
> +=======================================

nit: bad length of the ==== marker lines

> +def parse_attributes_set(entries: List[Dict[str, Any]]) -> str:

I'd rename to parse_attr_sets (plural sets).

> +    """Parse attribute from attribute-set"""
> +    preprocessed = ["name", "type"]
> +    ignored = ["checks"]
> +    lines = []
> +
> +    for entry in entries:
> +        lines.append(rst_bullet(bold(entry["name"])))

This would be better as subsubtitle.

> +        for attr in entry["attributes"]:
> +            type_ = attr.get("type")
> +            attr_line = bold(attr["name"])
> +            if type_:
> +                # Add the attribute type in the same line
> +                attr_line += f" ({inline(type_)})"
> +
> +            lines.append(rst_bullet(attr_line, 2))

And this actually, probably also a sub^3-title, because we'll want to
link to the specific attributes sooner or later. And linking to bullet
points isn't a thing (AFAIU?)

  reply	other threads:[~2023-11-06 22:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-03 13:56 [PATCH] Documentation: Document the Netlink spec Breno Leitao
2023-11-06 22:51 ` Jakub Kicinski [this message]
2023-11-08 14:03 ` Donald Hunter
2023-11-08 14:08   ` Donald Hunter
2023-11-09 18:28   ` Breno Leitao
2023-11-08 20:27 ` Jonathan Corbet
2023-11-09  1:43   ` Jakub Kicinski
2023-11-10  9:23     ` Donald Hunter
2023-11-09 11:22   ` Donald Hunter
2023-11-09 14:12     ` Jonathan Corbet
2023-11-09 15:16       ` Jakub Kicinski
2023-11-09 15:20       ` Breno Leitao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231106145111.3537538f@kernel.org \
    --to=kuba@kernel.org \
    --cc=corbet@lwn.net \
    --cc=edumazet@google.com \
    --cc=leitao@debian.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).