Is your feature request related to a problem? Please describe.
When running on CMakeTest, an index.rst file is created that includes the templates/ directory in the toctree, even though the directory does not contain any documentable CMake files.
Describe the solution you'd like
It would be nice to automatically exclude all directories that do not contain CMake files, as well as add a --exclude option to exclude files and folders matching a file glob.
Implementation details
This would require a refactoring of cminx.document() to delay index.rst writing. Due to using os.walk() we'd need to store the index RST writer objects across iterations, adding a subdirectory only after a .cmake file not matching the exclude filter is found. A stack should do nicely for this purpose
Is your feature request related to a problem? Please describe. When running on CMakeTest, an index.rst file is created that includes the
templates/
directory in the toctree, even though the directory does not contain any documentable CMake files.Describe the solution you'd like It would be nice to automatically exclude all directories that do not contain CMake files, as well as add a
--exclude
option to exclude files and folders matching a file glob.Implementation details This would require a refactoring of
cminx.document()
to delayindex.rst
writing. Due to usingos.walk()
we'd need to store the index RST writer objects across iterations, adding a subdirectory only after a.cmake
file not matching the exclude filter is found. A stack should do nicely for this purpose