From 4cec345028edc4a55deeeef89e5a13ad25d176cb Mon Sep 17 00:00:00 2001
From: Antoine Lambert <anlambert@softwareheritage.org>
Date: Mon, 19 Dec 2022 13:46:43 +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 4f6a4b37..846bbdb3 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -29,4 +29,12 @@ Reference Documentation
    :maxdepth: 2
 
    cli
-   /apidoc/swh.lister
+
+.. only:: standalone_package_doc
+
+   Indices and tables
+   ------------------
+
+   * :ref:`genindex`
+   * :ref:`modindex`
+   * :ref:`search`
-- 
GitLab