From b1b7d01172b78cd3f301fb77117a3b7191ca1f20 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 6 Dec 2019 10:07:31 -0500 Subject: Utilities/Sphinx: Index document types only by top level directory We use the convention `Help//` for indexing each document as an object of type ``. Split the document name on the first slash rather than the last slash so that multi-level documents like `Help/guide/tutorial/index.rst` are indexed as their top-level type. --- Utilities/Sphinx/cmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py index d903dbe..b9bf41b 100644 --- a/Utilities/Sphinx/cmake.py +++ b/Utilities/Sphinx/cmake.py @@ -251,7 +251,7 @@ class CMakeTransform(Transform): env = self.document.settings.env # Treat some documents as cmake domain objects. - objtype, sep, tail = env.docname.rpartition('/') + objtype, sep, tail = env.docname.partition('/') make_index_entry = _cmake_index_objs.get(objtype) if make_index_entry: title = self.parse_title(env.docname) -- cgit v0.12