Documentation: use a source-read extension for the index link boilerplate
authorJani Nikula <jani.nikula@intel.com>
Fri, 23 Jan 2026 14:31:49 +0000 (16:31 +0200)
committerJonathan Corbet <corbet@lwn.net>
Fri, 23 Jan 2026 18:59:34 +0000 (11:59 -0700)
The root document usually has a special :ref:`genindex` link to the
generated index. This is also the case for Documentation/index.rst. The
other index.rst files deeper in the directory hierarchy usually don't.

For SPHINXDIRS builds, the root document isn't Documentation/index.rst,
but some other index.rst in the hierarchy. Currently they have a
".. only::" block to add the index link when doing SPHINXDIRS html
builds.

This is obviously very tedious and repetitive. The link is also added to
all index.rst files in the hierarchy for SPHINXDIRS builds, not just the
root document.

Put the boilerplate in a sphinx-includes/subproject-index.rst file, and
include it at the end of the root document for subproject builds in an
ad-hoc source-read extension defined in conf.py.

For now, keep having the boilerplate in translations, because this
approach currently doesn't cover translated index link headers.

Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Tested-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
[jc: did s/doctree/kern_doc_dir/ ]
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20260123143149.2024303-1-jani.nikula@intel.com>

101 files changed:
Documentation/RCU/index.rst
Documentation/accel/index.rst
Documentation/admin-guide/aoe/index.rst
Documentation/admin-guide/auxdisplay/index.rst
Documentation/admin-guide/cgroup-v1/index.rst
Documentation/admin-guide/cifs/index.rst
Documentation/admin-guide/device-mapper/index.rst
Documentation/admin-guide/gpio/index.rst
Documentation/admin-guide/index.rst
Documentation/admin-guide/kdump/index.rst
Documentation/arch/arc/index.rst
Documentation/arch/arm/index.rst
Documentation/arch/arm64/index.rst
Documentation/arch/loongarch/index.rst
Documentation/arch/m68k/index.rst
Documentation/arch/mips/index.rst
Documentation/arch/openrisc/index.rst
Documentation/arch/parisc/index.rst
Documentation/arch/powerpc/index.rst
Documentation/arch/riscv/index.rst
Documentation/arch/s390/index.rst
Documentation/bpf/index.rst
Documentation/cdrom/index.rst
Documentation/conf.py
Documentation/core-api/index.rst
Documentation/core-api/kho/index.rst
Documentation/dev-tools/index.rst
Documentation/doc-guide/index.rst
Documentation/driver-api/80211/index.rst
Documentation/driver-api/coco/index.rst
Documentation/driver-api/crypto/iaa/index.rst
Documentation/driver-api/crypto/index.rst
Documentation/driver-api/cxl/index.rst
Documentation/driver-api/dmaengine/index.rst
Documentation/driver-api/driver-model/index.rst
Documentation/driver-api/early-userspace/index.rst
Documentation/driver-api/firmware/index.rst
Documentation/driver-api/index.rst
Documentation/driver-api/memory-devices/index.rst
Documentation/driver-api/pci/index.rst
Documentation/driver-api/phy/index.rst
Documentation/driver-api/pm/index.rst
Documentation/driver-api/serial/index.rst
Documentation/driver-api/soundwire/index.rst
Documentation/driver-api/surface_aggregator/clients/index.rst
Documentation/driver-api/surface_aggregator/index.rst
Documentation/driver-api/usb/index.rst
Documentation/driver-api/xilinx/index.rst
Documentation/fault-injection/index.rst
Documentation/fb/index.rst
Documentation/fpga/index.rst
Documentation/gpu/drivers.rst
Documentation/gpu/index.rst
Documentation/hwmon/index.rst
Documentation/i2c/index.rst
Documentation/infiniband/index.rst
Documentation/input/devices/index.rst
Documentation/input/index.rst
Documentation/isdn/index.rst
Documentation/kbuild/index.rst
Documentation/livepatch/index.rst
Documentation/locking/index.rst
Documentation/mhi/index.rst
Documentation/netlabel/index.rst
Documentation/networking/device_drivers/atm/index.rst
Documentation/networking/device_drivers/can/index.rst
Documentation/networking/device_drivers/cellular/index.rst
Documentation/networking/device_drivers/ethernet/index.rst
Documentation/networking/device_drivers/ethernet/mellanox/mlx5/index.rst
Documentation/networking/device_drivers/fddi/index.rst
Documentation/networking/device_drivers/hamradio/index.rst
Documentation/networking/device_drivers/index.rst
Documentation/networking/device_drivers/wifi/index.rst
Documentation/networking/device_drivers/wwan/index.rst
Documentation/networking/diagnostic/index.rst
Documentation/networking/index.rst
Documentation/pcmcia/index.rst
Documentation/peci/index.rst
Documentation/power/index.rst
Documentation/process/debugging/index.rst
Documentation/process/index.rst
Documentation/rust/index.rst
Documentation/scheduler/index.rst
Documentation/sound/index.rst
Documentation/sphinx-includes/subproject-index.rst [new file with mode: 0644]
Documentation/spi/index.rst
Documentation/target/index.rst
Documentation/tee/index.rst
Documentation/timers/index.rst
Documentation/tools/index.rst
Documentation/tools/rtla/index.rst
Documentation/tools/rv/index.rst
Documentation/trace/index.rst
Documentation/usb/index.rst
Documentation/userspace-api/gpio/index.rst
Documentation/userspace-api/index.rst
Documentation/virt/index.rst
Documentation/w1/index.rst
Documentation/watchdog/index.rst
Documentation/wmi/devices/index.rst
Documentation/wmi/index.rst

index ef26c78..0358716 100644 (file)
@@ -28,10 +28,3 @@ RCU Handbook
    Design/Expedited-Grace-Periods/Expedited-Grace-Periods
    Design/Requirements/Requirements
    Design/Data-Structures/Data-Structures
-
-.. only:: subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index d8fa332..cbc7d4c 100644 (file)
@@ -11,10 +11,3 @@ Compute Accelerators
    amdxdna/index
    qaic/index
    rocket/index
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index d71c5df..564354b 100644 (file)
@@ -8,10 +8,3 @@ ATA over Ethernet (AoE)
     aoe
     todo
     examples
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index e466f05..31eae08 100644 (file)
@@ -7,10 +7,3 @@ Auxiliary Display Support
 
     ks0108.rst
     cfag12864b.rst
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 99fbc8a..14897a8 100644 (file)
@@ -22,10 +22,3 @@ Control Groups version 1
     net_prio
     pids
     rdma
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index fad5268..58ab58a 100644 (file)
@@ -12,10 +12,3 @@ CIFS
    todo
    changes
    authors
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index f1c1f4b..030d854 100644 (file)
@@ -40,10 +40,3 @@ Device Mapper
     verity
     writecache
     zero
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 712f379..0826468 100644 (file)
@@ -12,10 +12,3 @@ GPIO
     gpio-sim
     gpio-virtuser
     Obsolete APIs <obsolete>
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 259d79f..b734f8a 100644 (file)
@@ -189,10 +189,3 @@ A few hard-to-categorize and generally obsolete documents.
 
    ldm
    unicode
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 8e2ebd0..cf5d7c8 100644 (file)
@@ -11,10 +11,3 @@ information.
 
     kdump
     vmcoreinfo
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 7b098d4..10bf8c2 100644 (file)
@@ -8,10 +8,3 @@ ARC architecture
     arc
 
     features
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index fd43502..afe17db 100644 (file)
@@ -75,11 +75,3 @@ SoC-specific documents
    sti/overview
 
    vfp/release-notes
-
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 6a012c9..af52edc 100644 (file)
@@ -33,10 +33,3 @@ ARM64 Architecture
     tagged-pointers
 
     features
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index c779bfa..df590b1 100644 (file)
@@ -13,10 +13,3 @@ LoongArch Architecture
    irq-chip-model
 
    features
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 0f890db..c334026 100644 (file)
@@ -11,10 +11,3 @@ m68k Architecture
    buddha-driver
 
    features
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 037f85a..703e195 100644 (file)
@@ -12,10 +12,3 @@ MIPS-specific Documentation
    ingenic-tcu
 
    features
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 6879f99..79fe8b0 100644 (file)
@@ -11,10 +11,3 @@ OpenRISC Architecture
    todo
 
    features
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 2406857..15ccc78 100644 (file)
@@ -11,10 +11,3 @@ PA-RISC Architecture
    registers
 
    features
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 1be2ee3..40419be 100644 (file)
@@ -40,10 +40,3 @@ powerpc
     vpa-dtl
 
     features
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index eecf347..830fde0 100644 (file)
@@ -16,10 +16,3 @@ RISC-V architecture
     cmodx
 
     features
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index e75a6e5..769434f 100644 (file)
@@ -22,10 +22,3 @@ s390 Architecture
     text_files
 
     features
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 0bb5cb8..0d5c6f6 100644 (file)
@@ -34,12 +34,5 @@ that goes into great technical depth about the BPF Architecture.
    other
    redirect
 
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
-
 .. Links:
 .. _BPF and XDP Reference Guide: https://docs.cilium.io/en/latest/bpf/
index 3ac4f71..50050e2 100644 (file)
@@ -8,10 +8,3 @@ CD-ROM
     :maxdepth: 1
 
     cdrom-standard
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 583be81..6798615 100644 (file)
@@ -42,7 +42,7 @@ exclude_patterns = []
 
 # List of patterns that contain directory names in glob format.
 dyn_include_patterns = []
-dyn_exclude_patterns = ["output"]
+dyn_exclude_patterns = ["output", "sphinx-includes"]
 
 # Currently, only netlink/specs has a parser for yaml.
 # Prefer using include patterns if available, as it is faster
@@ -587,7 +587,30 @@ pdf_documents = [
 
 kerneldoc_srctree = ".."
 
+# Add index link at the end of the root document for SPHINXDIRS builds.
+def add_subproject_index(app, docname, content):
+    # Only care about root documents
+    if docname != master_doc:
+        return
+
+    # Add the index link at the root of translations, but not at the root of
+    # individual translations. They have their own language specific links.
+    rel = os.path.relpath(app.srcdir, start=kern_doc_dir).split('/')
+    if rel[0] == 'translations' and len(rel) > 1:
+        return
+
+    # Only add the link for SPHINXDIRS HTML builds
+    if not app.builder.tags.has('subproject') or not app.builder.tags.has('html'):
+        return
+
+    # The include directive needs a relative path from the srcdir
+    rel = os.path.relpath(os.path.join(kern_doc_dir, 'sphinx-includes/subproject-index.rst'),
+                          start=app.srcdir)
+
+    content[0] += f'\n.. include:: {rel}\n\n'
+
 def setup(app):
     """Patterns need to be updated at init time on older Sphinx versions"""
 
     app.connect('config-inited', config_init)
+    app.connect('source-read', add_subproject_index)
index 5eb0fbb..51958ae 100644 (file)
@@ -140,10 +140,3 @@ Documents that don't fit elsewhere or which have yet to be categorized.
    librs
    liveupdate
    netlink
-
-.. only:: subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 0c63b0c..51ea41c 100644 (file)
@@ -9,5 +9,3 @@ Kexec Handover Subsystem
 
    concepts
    fdt
-
-.. only::  subproject and html
index 4b8425e..4fc9d15 100644 (file)
@@ -38,11 +38,3 @@ Documentation/process/debugging/index.rst
    gpio-sloppy-logic-analyzer
    autofdo
    propeller
-
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 24d058f..f078bad 100644 (file)
@@ -13,10 +13,3 @@ How to write kernel documentation
    contributing
    maintainer-profile
    checktransupdate
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index af21085..62305e9 100644 (file)
@@ -8,10 +8,3 @@ Linux 802.11 Driver Developer's Guide
    cfg80211
    mac80211
    mac80211-advanced
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index af9f08c..783c8b0 100644 (file)
@@ -8,5 +8,3 @@ Confidential Computing
    :maxdepth: 1
 
    measurement-registers
-
-.. only::  subproject and html
index aa6837e..463f7da 100644 (file)
@@ -11,10 +11,3 @@ API.
    :maxdepth: 1
 
    iaa-crypto
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index fb9709b..bba6690 100644 (file)
@@ -11,10 +11,3 @@ configuration.
    :maxdepth: 1
 
    iaa/index
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index c1106a6..ec8aae9 100644 (file)
@@ -50,5 +50,3 @@ that have impacts on each other.  The docs here break up configurations steps.
    allocation/page-allocator
    allocation/reclaim
    allocation/hugepages.rst
-
-.. only::  subproject and html
index bdc45d8..e74677c 100644 (file)
@@ -46,10 +46,3 @@ This book adds some notes about PXA DMA
    :maxdepth: 1
 
    pxa_dma
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 4831bdd..abeb4b3 100644 (file)
@@ -14,10 +14,3 @@ Driver Model
    overview
    platform
    porting
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 149c182..ff45947 100644 (file)
@@ -9,10 +9,3 @@ Early Userspace
 
     early_userspace_support
     buffer-format
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 9d2c19d..86a3dd4 100644 (file)
@@ -10,10 +10,3 @@ Linux Firmware API
    request_firmware
    fw_upload
    other_interfaces
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 1833e6a..eaf7161 100644 (file)
@@ -149,10 +149,3 @@ Subsystem-specific APIs
    wmi
    xilinx/index
    zorro
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 2810145..3b63081 100644 (file)
@@ -9,10 +9,3 @@ Memory Controller drivers
 
     ti-emif
     ti-gpmc
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 9e1b801..1abfbec 100644 (file)
@@ -11,10 +11,3 @@ The Linux PCI driver implementer's API guide
    pci
    p2pdma
    tsm
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 69ba121..579cfe3 100644 (file)
@@ -8,11 +8,3 @@ Generic PHY Framework
 
    phy
    samsung-usb2
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
-
index c2a9ef8..4d6c32e 100644 (file)
@@ -10,10 +10,3 @@ CPU and Device Power Management
    devices
    notifiers
    types
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 03a55b9..610744d 100644 (file)
@@ -18,10 +18,3 @@ Serial drivers
 
     serial-iso7816
     serial-rs485
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index ef8d90d..f7abf4a 100644 (file)
@@ -11,10 +11,3 @@ SoundWire Documentation
    locking
    bra
    bra_cadence
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 3016051..c32313b 100644 (file)
@@ -14,10 +14,3 @@ on how to write client drivers.
    cdev
    dtx
    san
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 6f3e109..f0128fe 100644 (file)
@@ -12,10 +12,3 @@ Surface System Aggregator Module (SSAM)
    clients/index
    ssh
    internal
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index fcb24d0..a328199 100644 (file)
@@ -22,10 +22,3 @@ Linux USB API
    typec
    typec_bus
    usb3-debug-port
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 13f7589..c95bda5 100644 (file)
@@ -7,10 +7,3 @@ Xilinx FPGA
     :maxdepth: 1
 
     eemi
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index a6ea1d1..2a9e30b 100644 (file)
@@ -11,10 +11,3 @@ Fault-injection
     notifier-error-inject
     nvme-fault-injection
     provoke-crashes
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index e2f7488..fe9ca35 100644 (file)
@@ -50,10 +50,3 @@ Driver documentation
    vesafb
    viafb
    vt8623fb
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 43c9688..c5a8761 100644 (file)
@@ -8,10 +8,3 @@ FPGA
     :maxdepth: 1
 
     dfl
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 78b80be..2e13e0a 100644 (file)
@@ -26,10 +26,3 @@ GPU Driver Documentation
    panthor
    zynqmp
    nova/index
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 7dcb158..2fafa1f 100644 (file)
@@ -22,10 +22,3 @@ GPU Driver Developer's Guide
    implementation_guidelines
    todo
    rfc/index
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 85d7a68..fc9d39b 100644 (file)
@@ -281,10 +281,3 @@ Hardware Monitoring Kernel Drivers
    xdpe12284
    xdpe152c4
    zl6100
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 2b213d4..ccf1371 100644 (file)
@@ -66,10 +66,3 @@ Legacy documentation
    :maxdepth: 1
 
    old-module-parameters
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 5b4c241..c11049d 100644 (file)
@@ -15,10 +15,3 @@ InfiniBand
    ucaps
    user_mad
    user_verbs
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 95a4537..6de4365 100644 (file)
@@ -10,10 +10,3 @@ Linux kernel, their protocols, and driver details.
    :glob:
 
    *
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 35581cd..fbde5bc 100644 (file)
@@ -10,10 +10,3 @@ Contents:
    input_uapi
    input_kapi
    devices/index
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 9622939..d1125a1 100644 (file)
@@ -12,10 +12,3 @@ ISDN
    m_isdn
 
    credits
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 3731ab2..f46233b 100644 (file)
@@ -24,10 +24,3 @@ Kernel Build System
     gendwarfksyms
 
     bash-completion
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index cebf1c7..d2e7aa0 100644 (file)
@@ -15,10 +15,3 @@ Kernel Livepatching
     system-state
     reliable-stacktrace
     api
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 6a9ea96..9278d95 100644 (file)
@@ -24,10 +24,3 @@ Locking
     percpu-rw-semaphore
     robust-futexes
     robust-futex-ABI
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 1d8dec3..0aa0048 100644 (file)
@@ -9,10 +9,3 @@ MHI
 
    mhi
    topology
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 984e1b1..bb6ba7d 100644 (file)
@@ -12,10 +12,3 @@ NetLabel
     lsm_interface
 
     draft_ietf
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 7b593f0..724552c 100644 (file)
@@ -11,10 +11,3 @@ Contents:
    cxacru
    fore200e
    iphase
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 6a8a4f7..af43699 100644 (file)
@@ -13,10 +13,3 @@ Contents:
    can327
    ctu/ctucanfd-driver
    freescale/flexcan
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index fc1812d..9690c3b 100644 (file)
@@ -9,10 +9,3 @@ Contents:
    :maxdepth: 2
 
    qualcomm/rmnet
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index bcc0235..142ac0b 100644 (file)
@@ -64,10 +64,3 @@ Contents:
    wangxun/txgbevf
    wangxun/ngbe
    wangxun/ngbevf
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 581a91c..56f3966 100644 (file)
@@ -16,10 +16,3 @@ Contents:
    switchdev
    tracepoints
    counters
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 0b75294..c7cf234 100644 (file)
@@ -10,10 +10,3 @@ Contents:
 
    defza
    skfp
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 7e73173..6af481c 100644 (file)
@@ -10,10 +10,3 @@ Contents:
 
    baycom
    z8530drv
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index a254af2..1df51c9 100644 (file)
@@ -16,10 +16,3 @@ Contents:
    hamradio/index
    wifi/index
    wwan/index
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index fb394f5..29ba9ea 100644 (file)
@@ -10,10 +10,3 @@ Contents:
 
    intel/ipw2100
    intel/ipw2200
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 370d826..b768ae8 100644 (file)
@@ -10,10 +10,3 @@ Contents:
 
    iosm
    t7xx
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 86488aa..592263a 100644 (file)
@@ -8,10 +8,3 @@ Networking Diagnostics
    :maxdepth: 2
 
    twisted_pair_layer1_diagnostics.rst
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 75db225..0f72de9 100644 (file)
@@ -134,10 +134,3 @@ Contents:
    xfrm/index
    xdp-rx-metadata
    xsk-tx-metadata
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 8067236..89c0048 100644 (file)
@@ -11,10 +11,3 @@ PCMCIA
     devicetable
     locking
     driver-changes
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 930e752..1443c31 100644 (file)
@@ -7,10 +7,3 @@ PECI Subsystem
 .. toctree::
 
    peci
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index ea70633..b4581e4 100644 (file)
@@ -38,10 +38,3 @@ Power Management
     regulator/machine
     regulator/overview
     regulator/regulator
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 387d33d..357243e 100644 (file)
@@ -15,8 +15,6 @@ general guides
    kgdb
    userspace_debugging_guide
 
-.. only::  subproject and html
-
 subsystem specific guides
 -------------------------
 
@@ -25,13 +23,6 @@ subsystem specific guides
 
    media_specific_debugging_guide
 
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
-
 General debugging advice
 ========================
 
index 9d1a733..7bea184 100644 (file)
@@ -110,10 +110,3 @@ developers:
 
    kernel-docs
    deprecated
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index ec62001..7a31843 100644 (file)
@@ -58,10 +58,3 @@ more details.
 
 You can also find learning materials for Rust in its section in
 :doc:`../process/kernel-docs`.
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 5dd53e4..17ce8d7 100644 (file)
@@ -25,10 +25,3 @@ Scheduler
     sched-debug
 
     text_files
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 51cd736..c075ca6 100644 (file)
@@ -15,10 +15,3 @@ Sound Subsystem Documentation
    cards/index
    codecs/index
    utimers
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
diff --git a/Documentation/sphinx-includes/subproject-index.rst b/Documentation/sphinx-includes/subproject-index.rst
new file mode 100644 (file)
index 0000000..efffdb5
--- /dev/null
@@ -0,0 +1,7 @@
+.. SPDX-License-Identifier: GPL-2.0
+.. This file is included in subproject root documents in conf.py
+
+Indices
+=======
+
+* :ref:`genindex`
index 824ce42..20d4a41 100644 (file)
@@ -12,10 +12,3 @@ Serial Peripheral Interface (SPI)
    butterfly
    spi-lm70llp
    spi-sc18is602
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 4b24f81..51fa8eb 100644 (file)
@@ -10,10 +10,3 @@ TCM Virtual Device
     tcmu-design
     tcm_mod_builder
     scripts
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 62afb7e..10c3cec 100644 (file)
@@ -12,10 +12,3 @@ TEE Subsystem
    amd-tee
    ts-tee
    qtee
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 4e88116..c835275 100644 (file)
@@ -13,10 +13,3 @@ Timers
     no_hz
     timekeeping
     delay_sleep_functions
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 89b81a1..5f2f63b 100644 (file)
@@ -13,10 +13,3 @@ more additions are needed here:
    rtla/index
    rv/index
    python
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 05d2652..7664d6d 100644 (file)
@@ -18,10 +18,3 @@ behavior on specific hardware.
    rtla-timerlat-hist
    rtla-timerlat-top
    rtla-hwnoise
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 64ba2ef..fd42b00 100644 (file)
@@ -16,10 +16,3 @@ Runtime verification (rv) tool
    rv-mon-wip
    rv-mon-wwnr
    rv-mon-sched
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index b4a429d..cfd8128 100644 (file)
@@ -95,10 +95,3 @@ Additional Resources
 
 For more details, refer to the respective documentation of each
 tracing tool and framework.
-
-.. only:: subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 826492c..605233f 100644 (file)
@@ -31,10 +31,3 @@ USB support
 
     usb-help
     text_files
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index f258de4..ac9c6ff 100644 (file)
@@ -9,10 +9,3 @@ GPIO
 
     Character Device Userspace API <chardev>
     Obsolete Userspace APIs <obsolete>
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 8a61ac4..6f0235e 100644 (file)
@@ -68,10 +68,3 @@ Everything else
    futex2
    perf_ring_buffer
    ntsync
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 7fb55ae..c1f0bbc 100644 (file)
@@ -16,10 +16,3 @@ Virtualization Support
    coco/sev-guest
    coco/tdx-guest
    hyperv/index
-
-.. only:: html and subproject
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 156279f..2e7bd8a 100644 (file)
    w1-netlink.rst
    masters/index
    slaves/index
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index 4603f25..1cea246 100644 (file)
@@ -16,10 +16,3 @@ Watchdog Support
     watchdog-pm
     wdt
     convert_drivers_to_kernel_api
-
-.. only::  subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index c08735a..b0a9b42 100644 (file)
@@ -13,10 +13,3 @@ the Linux kernel, their protocols and driver details.
    :glob:
 
    *
-
-.. only:: subproject and html
-
-   Indices
-   =======
-
-   * :ref:`genindex`
index fec4b6a..5601607 100644 (file)
@@ -10,11 +10,3 @@ WMI Subsystem
    acpi-interface
    driver-development-guide
    devices/index
-
-.. only::  subproject and html
-
-
-   Indices
-   =======
-
-   * :ref:`genindex`