1
0
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:
Brad King
2019-12-06 10:07:31 -05:00
committed by Stephen Kelly
parent e4c0711602
commit b1b7d01172

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)