Commit a5112642 authored by Matthieu Baerts (NGI0)'s avatar Matthieu Baerts (NGI0) Committed by Jakub Kicinski
Browse files

tools: ynl: rst: display attribute-set doc



Some attribute-set have a documentation (doc:), but it was not displayed
in the RST / HTML version. Such field can be found in ethtool, netdev,
tcp_metrics and team YAML files.

Only the 'name' and 'attributes' fields from an 'attribute-set' section
were parsed. Now the content of the 'doc' field, if available, is added
as a new paragraph before listing each attribute. This is similar to
what is done when parsing the 'operations'.

Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20250913-net-next-ynl-attr-doc-rst-v3-1-4f06420d87db@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 7acc8b90
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -289,6 +289,10 @@ class YnlDocGenerator:
        for entry in entries:
            lines.append(self.fmt.rst_section(namespace, 'attribute-set',
                                              entry["name"]))

            if "doc" in entry:
                lines.append(self.fmt.rst_paragraph(entry["doc"], 0) + "\n")

            for attr in entry["attributes"]:
                if LINE_STR in attr:
                    lines.append(self.fmt.rst_lineno(attr[LINE_STR]))