mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-16 05:26:58 +08:00
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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user