summaryrefslogtreecommitdiff
path: root/tools/net/ynl/pyynl/lib/doc_generator.py
AgeCommit message (Collapse)Author
2025-09-15tools: ynl: rst: display attribute-set docMatthieu Baerts (NGI0)
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>
2025-08-12docs: parser_yaml.py: add support for line numbers from the parserMauro Carvalho Chehab
Instead of printing line numbers from the temp converted ReST file, get them from the original source. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2025-08-12tools: netlink_yml_parser.py: add line numbers to parsed dataMauro Carvalho Chehab
When something goes wrong, we want Sphinx error to point to the right line number from the original source, not from the processed ReST data. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2025-08-12tools: ynl_gen_rst.py: cleanup coding styleMauro Carvalho Chehab
Cleanup some coding style issues pointed by pylint and flake8. No functional changes. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Reviewed-by: Breno Leitao <leitao@debian.org> Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
2025-08-12tools: ynl_gen_rst.py: Split library from command line toolMauro Carvalho Chehab
As we'll be using the Netlink specs parser inside a Sphinx extension, move the library part from the command line parser. While here, change the code which generates an index file to parse inputs from both .rst and .yaml extensions. With that, the tool can easily be tested with: tools/net/ynl/pyynl/ynl_gen_rst.py -x -o Documentation/netlink/specs/foo.rst Without needing to first generate a temp directory with the rst files. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Reviewed-by: Donald Hunter <donald.hunter@gmail.com>