diff options
author | Matthieu Baerts (NGI0) <matttbe@kernel.org> | 2025-09-13 15:29:51 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2025-09-15 18:27:19 -0700 |
commit | a51126424f75a7b44b11f7b821f6abb0b78bd931 (patch) | |
tree | b663fbc3c25d2e3ab7f38bf8f05c319f8d1eeb1a /tools/net/ynl/pyynl/lib/doc_generator.py | |
parent | 7acc8b904836f7e72833526279e7eef09b4b9065 (diff) |
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: Matthieu 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: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/net/ynl/pyynl/lib/doc_generator.py')
-rw-r--r-- | tools/net/ynl/pyynl/lib/doc_generator.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/net/ynl/pyynl/lib/doc_generator.py b/tools/net/ynl/pyynl/lib/doc_generator.py index 403abf1a2eda..3a16b8eb01ca 100644 --- a/tools/net/ynl/pyynl/lib/doc_generator.py +++ b/tools/net/ynl/pyynl/lib/doc_generator.py @@ -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])) |