]> git.ipfire.org Git - thirdparty/linux.git/commit
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)
commita592a36e49372172d7c7551ec19ed18184c935e1
treefdf17b7629af934f4cbb42350f4aff55f402aefd
parent330367bdc176a8f52cc4c5065ba0312277202dee
Documentation: use a source-read extension for the index link boilerplate

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