Utilities/Sphinx: Index document types only by top level directory

We use the convention `Help/<type>/<doc>` for indexing each document as
an object of type `<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.
This commit is contained in:
Brad King
2020-01-13 11:08:11 +00:00
committed by Stephen Kelly
parent e4c0711602
commit b1b7d01172
+1 -1
View File
@@ -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)