From 788ded90baeea7069b5c646658fd7cabb21ffc41 Mon Sep 17 00:00:00 2001
From: Antoine Lambert <anlambert@softwareheritage.org>
Date: Mon, 19 Dec 2022 13:31:03 +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 bc7e9003..4df601f2 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -18,4 +18,12 @@ Reference Documentation
    :maxdepth: 2
 
    cli
-   /apidoc/swh.deposit
+
+.. only:: package_doc
+
+   Indices and tables
+   ------------------
+
+   * :ref:`genindex`
+   * :ref:`modindex`
+   * :ref:`search`
-- 
GitLab