From nobody Fri Oct 10 18:18:31 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 515042E7F0E; Fri, 13 Jun 2025 11:42:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749814967; cv=none; b=AxFUYCCynBo46xf/5JQaw8tOb8MZqlFW4u59VeNu89ssSBvILV9RAcv8/DrF5+Kl1XSxcIlyS2ZhZ57ysLfWkgAg0ysscGU9UeWmOyv0iTCKcbAmio86S+HT1jFyVJdfOyLu/ixj0GDI3niTaFo844iW+nHIKC/qYsN4jr4GjQ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749814967; c=relaxed/simple; bh=YBkjGXm+GCy8o/xx1o50ol5uO7XCwqyBr79mwHQ/z4o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F/NLc+ox9zW5/e65YRhe98XGdHhN/tmbS1UueCq3/l+pMLQjVSnKFngI+nrjyWg1XO+f0feXGcS3y5xN6RyPix5jcE8abW6iA89ODSZFOdgRGBSRoxAUSLJxnFd64GlQkrRbxCWzzvDrZSxd9qxBOEov2v3gNe8rAJWnR97W1r0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Gy3mxKtn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Gy3mxKtn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD90DC4CEFC; Fri, 13 Jun 2025 11:42:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1749814966; bh=YBkjGXm+GCy8o/xx1o50ol5uO7XCwqyBr79mwHQ/z4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gy3mxKtnerMdNmaAfxLjcCdYev3j4LJ4Ma6S4xmXIuYZOG5rTcqSp0P2bRHTcy7p3 Q9XbPn9aViuqPD94eHh5mePfrxKwfdO7i1SHNE9dNOkIH+Vui3LO7z8csPWQqnIkhm dBzRPx2+UYNo/UsfKSPD6YnB40Xu2cuBZfAnko6dOv/IC/ydzWYY/NNUWLBzIUJ2YD D+rn48dAvUPrssNOtTYiC5OfHMtzPvyVATuWmTz6n7Arh6x4Jz54HMIw7GZ073lPpL bjRdJpknjpciPMeJ5Trr37i0QpZNlbMzlA+vgsC3X6qXhowmDSdOm1kBJn4vqIYxMU 0jS65AuRqEnEA== Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1uQ2o1-00000005dFP-0XeS; Fri, 13 Jun 2025 13:42:45 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , "Akira Yokosawa" , "Breno Leitao" , "David S. Miller" , "Donald Hunter" , "Eric Dumazet" , "Ignacio Encinas Rubio" , "Jan Stancek" , "Marco Elver" , "Mauro Carvalho Chehab" , "Paolo Abeni" , "Ruben Wauters" , "Shuah Khan" , Jakub Kicinski , Simon Horman , joel@joelfernandes.org, linux-kernel-mentees@lists.linux.dev, linux-kernel@vger.kernel.org, lkmm@lists.linux.dev, netdev@vger.kernel.org, peterz@infradead.org, stern@rowland.harvard.edu Subject: [PATCH v3 11/16] docs: use parser_yaml extension to handle Netlink specs Date: Fri, 13 Jun 2025 13:42:32 +0200 Message-ID: <931e46a6fdda4fa67df731b052c121b9094fbd8a.1749812870.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" Instead of manually calling ynl_gen_rst.py, use a Sphinx extension. This way, no .rst files would be written to the Kernel source directories. Signed-off-by: Mauro Carvalho Chehab --- Documentation/Makefile | 17 --------- Documentation/conf.py | 11 +++--- Documentation/netlink/specs/index.rst | 38 +++++++++++++++++++ Documentation/networking/index.rst | 2 +- .../networking/netlink_spec/readme.txt | 4 -- Documentation/sphinx/parser_yaml.py | 2 +- 6 files changed, 46 insertions(+), 28 deletions(-) create mode 100644 Documentation/netlink/specs/index.rst delete mode 100644 Documentation/networking/netlink_spec/readme.txt diff --git a/Documentation/Makefile b/Documentation/Makefile index d30d66ddf1ad..9185680b1e86 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -102,22 +102,6 @@ quiet_cmd_sphinx =3D SPHINX $@ --> file://$(abspath $= (BUILDDIR)/$3/$4) cp $(if $(patsubst /%,,$(DOCS_CSS)),$(abspath $(srctree)/$(DOCS_CSS)),$(= DOCS_CSS)) $(BUILDDIR)/$3/_static/; \ fi =20 -YNL_INDEX:=3D$(srctree)/Documentation/networking/netlink_spec/index.rst -YNL_RST_DIR:=3D$(srctree)/Documentation/networking/netlink_spec -YNL_YAML_DIR:=3D$(srctree)/Documentation/netlink/specs -YNL_TOOL:=3D$(srctree)/tools/net/ynl/pyynl/ynl_gen_rst.py - -YNL_RST_FILES_TMP :=3D $(patsubst %.yaml,%.rst,$(wildcard $(YNL_YAML_DIR)/= *.yaml)) -YNL_RST_FILES :=3D $(patsubst $(YNL_YAML_DIR)%,$(YNL_RST_DIR)%, $(YNL_RST_= FILES_TMP)) - -$(YNL_INDEX): $(YNL_RST_FILES) - $(Q)$(YNL_TOOL) -o $@ -x - -$(YNL_RST_DIR)/%.rst: $(YNL_YAML_DIR)/%.yaml $(YNL_TOOL) - $(Q)$(YNL_TOOL) -i $< -o $@ - -htmldocs texinfodocs latexdocs epubdocs xmldocs: $(YNL_INDEX) - htmldocs: @$(srctree)/scripts/sphinx-pre-install --version-check @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var))) @@ -184,7 +168,6 @@ refcheckdocs: $(Q)cd $(srctree);scripts/documentation-file-ref-check =20 cleandocs: - $(Q)rm -f $(YNL_INDEX) $(YNL_RST_FILES) $(Q)rm -rf $(BUILDDIR) $(Q)$(MAKE) BUILDDIR=3D$(abspath $(BUILDDIR)) $(build)=3DDocumentation/us= erspace-api/media clean =20 diff --git a/Documentation/conf.py b/Documentation/conf.py index 12de52a2b17e..add6ce78dd80 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -45,7 +45,7 @@ needs_sphinx =3D '3.4.3' extensions =3D ['kerneldoc', 'rstFlatTable', 'kernel_include', 'kfigure', 'sphinx.ext.ifconfig', 'automarkup', 'maintainers_include', 'sphinx.ext.autosectionlabel', - 'kernel_abi', 'kernel_feat', 'translations'] + 'kernel_abi', 'kernel_feat', 'translations', 'parser_yaml'] =20 # Since Sphinx version 3, the C function parser is more pedantic with rega= rds # to type checking. Due to that, having macros at c:function cause problem= s. @@ -143,10 +143,11 @@ else: # Add any paths that contain templates here, relative to this directory. templates_path =3D ['sphinx/templates'] =20 -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix =3D ['.rst', '.md'] -source_suffix =3D '.rst' +# The suffixes of source filenames that will be automatically parsed +source_suffix =3D { + '.rst': 'restructuredtext', + '.yaml': 'yaml', +} =20 # The encoding of source files. #source_encoding =3D 'utf-8-sig' diff --git a/Documentation/netlink/specs/index.rst b/Documentation/netlink/= specs/index.rst new file mode 100644 index 000000000000..ca0bf816dc3f --- /dev/null +++ b/Documentation/netlink/specs/index.rst @@ -0,0 +1,38 @@ +.. SPDX-License-Identifier: GPL-2.0 +.. NOTE: This document was auto-generated. + +.. _specs: + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D +Netlink Family Specifications +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D + +.. toctree:: + :maxdepth: 1 + + conntrack + devlink + dpll + ethtool + fou + handshake + lockd + mptcp_pm + net_shaper + netdev + nfsd + nftables + nl80211 + nlctrl + ovpn + ovs_datapath + ovs_flow + ovs_vport + rt-addr + rt-link + rt-neigh + rt-route + rt-rule + tc + tcp_metrics + team diff --git a/Documentation/networking/index.rst b/Documentation/networking/= index.rst index ac90b82f3ce9..b7a4969e9bc9 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -57,7 +57,7 @@ Contents: filter generic-hdlc generic_netlink - netlink_spec/index + ../netlink/specs/index gen_stats gtp ila diff --git a/Documentation/networking/netlink_spec/readme.txt b/Documentati= on/networking/netlink_spec/readme.txt deleted file mode 100644 index 030b44aca4e6..000000000000 --- a/Documentation/networking/netlink_spec/readme.txt +++ /dev/null @@ -1,4 +0,0 @@ -SPDX-License-Identifier: GPL-2.0 - -This file is populated during the build of the documentation (htmldocs) by= the -tools/net/ynl/pyynl/ynl_gen_rst.py script. diff --git a/Documentation/sphinx/parser_yaml.py b/Documentation/sphinx/par= ser_yaml.py index eb32e3249274..cdcafe5b3937 100755 --- a/Documentation/sphinx/parser_yaml.py +++ b/Documentation/sphinx/parser_yaml.py @@ -55,7 +55,7 @@ class YamlParser(Parser): fname =3D document.current_source =20 # Handle netlink yaml specs - if re.search("/netlink/specs/", fname): + if re.search("netlink/specs/", fname): if fname.endswith("index.yaml"): msg =3D self.netlink_parser.generate_main_index_rst(fname,= None) else: --=20 2.49.0