From 92781a65b25ccb1f69ec08110eec97c3a74ec2c0 Mon Sep 17 00:00:00 2001
From: Antoine Lambert <anlambert@softwareheritage.org>
Date: Mon, 19 Dec 2022 13:31:54 +0100
Subject: [PATCH] docs: Include module indices only when building standalone
 package doc

In order to remove warnings about /apidoc/*.rst files being included
multiple times in toc when building full swh documentation, prefer to
include module indices only when building standalone package documentation.

Also include them the proper sphinx way.

Related to T4496
---
 docs/index.rst | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/docs/index.rst b/docs/index.rst
index ef0b63c..8db6a8f 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -11,4 +11,12 @@
    configuration
    Design notes <design>
    Tutorial <tutorial>
-   API reference </apidoc/swh.fuse>
+
+.. only:: package_doc
+
+   Indices and tables
+   ------------------
+
+   * :ref:`genindex`
+   * :ref:`modindex`
+   * :ref:`search`
-- 
GitLab