From 4c595580f9a6fcf743e4c6681ff7f5e3e2ba2554 Mon Sep 17 00:00:00 2001
From: Antoine Lambert <anlambert@softwareheritage.org>
Date: Mon, 19 Dec 2022 13:19:57 +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 | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/docs/index.rst b/docs/index.rst
index 28c50c6..a7d4dd3 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -10,4 +10,13 @@ Reference Documentation
 
    cli
    django
-   /apidoc/swh.auth
+
+
+.. only:: package_doc
+
+   Indices and tables
+   ------------------
+
+   * :ref:`genindex`
+   * :ref:`modindex`
+   * :ref:`search`
-- 
GitLab