]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tools: docs: parse_data_structs.py: drop contents header
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 1 Oct 2025 14:49:24 +0000 (16:49 +0200)
committerJonathan Corbet <corbet@lwn.net>
Fri, 17 Oct 2025 19:56:59 +0000 (13:56 -0600)
When used in practice, one may want to have multiple header
files on a single rst file, like:

***********************
Digital TV uAPI symbols
***********************

.. contents:: Table of Contents
   :depth: 2
   :local:

Frontend
========

.. kernel-include:: include/uapi/linux/dvb/frontend.h
    :generate-cross-refs:
    :toc:

Demux
=====

.. kernel-include:: include/uapi/linux/dvb/dmx.h
    :generate-cross-refs:
    :toc:

...

So, don't add ..contents:: here.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <4bf353e5248133a3b0abd82519a38453402fe7c6.1759329363.git.mchehab+huawei@kernel.org>

tools/docs/lib/parse_data_structs.py

index a5aa2e182052b5137f936b54b3944a3532ecc6c4..6c868f84f029333a11e5902d0dc05ef97d209472 100755 (executable)
@@ -397,16 +397,10 @@ class ParseDataStructs:
 
     def gen_toc(self):
         """
-        Create a TOC table pointing to each symbol from the header
+        Create a list of symbols to be part of a TOC contents table
         """
         text = []
 
-        # Add header
-        text.append(".. contents:: Table of Contents")
-        text.append("   :depth: 2")
-        text.append("   :local:")
-        text.append("")
-
         # Sort symbol types per description
         symbol_descriptions = []
         for k, v in self.DEF_SYMBOL_TYPES.items():