linux/Documentation/dev-tools
Jani Nikula a592a36e49 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>
2026-01-23 11:59:34 -07:00
..
kunit Documentation: kunit: add description of kunit.enable parameter 2025-10-27 11:16:09 -06:00
lkmm docs: dev-tools/lkmm: Fix typo of missing file extension 2025-09-21 16:22:09 -06:00
autofdo.rst Documentation: dev-tools: Fix a typo in autofdo documentation 2025-09-03 15:44:14 -06:00
checkpatch.rst docs: Update documentation to avoid mentioning of kernel.h 2025-12-22 14:59:18 -07:00
checkuapi.rst docs: dev-tools: Add UAPI checker documentation 2023-12-29 22:25:21 +09:00
clang-format.rst docs: fix typo in clang-format documentation 2025-12-22 15:18:57 -07:00
coccinelle.rst kbuild: change working directory to external module directory with M= 2024-11-28 08:10:23 +09:00
gcov.rst docs: gcov: fix link to LCOV website 2024-10-07 11:50:54 -06:00
gpio-sloppy-logic-analyzer.rst gpio: add sloppy logic analyzer using polling 2024-07-01 10:54:11 +02:00
index.rst Documentation: use a source-read extension for the index link boilerplate 2026-01-23 11:59:34 -07:00
kasan.rst kasan/hw-tags: introduce kasan.write_only option 2025-09-21 14:22:10 -07:00
kcov.rst kcov: load acquire coverage count in user-space code 2025-09-13 17:32:44 -07:00
kcsan.rst Documentation: kcsan: fix "Plain Accesses and Data Races" URL in kcsan.rst 2025-03-12 16:34:55 -06:00
kfence.rst kfence: introduce burst mode 2024-09-01 20:26:03 -07:00
kmemleak.rst kmemleak: iommu/iova: fix transient kmemleak false positive 2024-11-11 17:22:26 -08:00
kmsan.rst docs/dev-tools: fix a typo 2024-10-17 09:39:19 -06:00
kselftest.rst printf: convert self-test to KUnit 2025-03-13 10:26:33 -07:00
ktap.rst Documentation: ktap: Separate first bullet list items 2025-08-18 10:28:44 -06:00
propeller.rst kbuild: Add Propeller configuration for kernel build 2024-11-27 09:38:27 +09:00
sparse.rst Documentation/sparse: add hints about __CHECKER__ 2022-03-23 19:00:33 -07:00
testing-devices.rst docs: dev-tools: Add documentation for the device focused kselftests 2024-10-14 16:15:13 -06:00
testing-overview.rst Documentation: dev-tools: Add link to RV docs 2024-03-29 08:27:21 -06:00
ubsan.rst ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL 2024-02-06 02:21:38 -08:00