]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
docs: sphinx: add a parser for yaml files for Netlink specs
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 12 Jun 2025 07:58:56 +0000 (09:58 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 12 Aug 2025 05:47:30 +0000 (07:47 +0200)
commitbb1e3629b2e684e03adb21d75c7839f3afeb488e
treec09e5071dae62b7461de0b765d207a80ffde2a68
parent3a3b8a144754858b59f108c7dc80eb613bf6fe64
docs: sphinx: add a parser for yaml files for Netlink specs

Add a simple sphinx.Parser to handle yaml files and add the
the code to handle Netlink specs. All other yaml files are
ignored.

The code was written in a way that parsing yaml for different
subsystems and even for different parts of Netlink are easy.

All it takes to have a different parser is to add an
import line similar to:

from doc_generator import YnlDocGenerator

adding the corresponding parser somewhere at the extension:

netlink_parser = YnlDocGenerator()

And then add a logic inside parse() to handle different
doc outputs, depending on the file location, similar to:

        if "/netlink/specs/" in fname:
            msg = self.netlink_parser.parse_yaml_file(fname)

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Documentation/sphinx/parser_yaml.py [new file with mode: 0755]