Skip to content

Commit a592a36

Browse files
jnikulaJonathan Corbet
authored andcommitted
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>
1 parent 330367b commit a592a36

101 files changed

Lines changed: 31 additions & 685 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/RCU/index.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,3 @@ RCU Handbook
2828
Design/Expedited-Grace-Periods/Expedited-Grace-Periods
2929
Design/Requirements/Requirements
3030
Design/Data-Structures/Data-Structures
31-
32-
.. only:: subproject and html
33-
34-
Indices
35-
=======
36-
37-
* :ref:`genindex`

Documentation/accel/index.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,3 @@ Compute Accelerators
1111
amdxdna/index
1212
qaic/index
1313
rocket/index
14-
15-
.. only:: subproject and html
16-
17-
Indices
18-
=======
19-
20-
* :ref:`genindex`

Documentation/admin-guide/aoe/index.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,3 @@ ATA over Ethernet (AoE)
88
aoe
99
todo
1010
examples
11-
12-
.. only:: subproject and html
13-
14-
Indices
15-
=======
16-
17-
* :ref:`genindex`

Documentation/admin-guide/auxdisplay/index.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,3 @@ Auxiliary Display Support
77

88
ks0108.rst
99
cfag12864b.rst
10-
11-
.. only:: subproject and html
12-
13-
Indices
14-
=======
15-
16-
* :ref:`genindex`

Documentation/admin-guide/cgroup-v1/index.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,3 @@ Control Groups version 1
2222
net_prio
2323
pids
2424
rdma
25-
26-
.. only:: subproject and html
27-
28-
Indices
29-
=======
30-
31-
* :ref:`genindex`

Documentation/admin-guide/cifs/index.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,3 @@ CIFS
1212
todo
1313
changes
1414
authors
15-
16-
.. only:: subproject and html
17-
18-
Indices
19-
=======
20-
21-
* :ref:`genindex`

Documentation/admin-guide/device-mapper/index.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,3 @@ Device Mapper
4040
verity
4141
writecache
4242
zero
43-
44-
.. only:: subproject and html
45-
46-
Indices
47-
=======
48-
49-
* :ref:`genindex`

Documentation/admin-guide/gpio/index.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,3 @@ GPIO
1212
gpio-sim
1313
gpio-virtuser
1414
Obsolete APIs <obsolete>
15-
16-
.. only:: subproject and html
17-
18-
Indices
19-
=======
20-
21-
* :ref:`genindex`

Documentation/admin-guide/index.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,3 @@ A few hard-to-categorize and generally obsolete documents.
189189

190190
ldm
191191
unicode
192-
193-
.. only:: subproject and html
194-
195-
Indices
196-
=======
197-
198-
* :ref:`genindex`

Documentation/admin-guide/kdump/index.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,3 @@ information.
1111

1212
kdump
1313
vmcoreinfo
14-
15-
.. only:: subproject and html
16-
17-
Indices
18-
=======
19-
20-
* :ref:`genindex`

0 commit comments

Comments
 (0)