CMakePP / CMinx

Generates API documentation for CMake functions and macros
https://cmakepp.github.io/CMinx/
Apache License 2.0
14 stars 5 forks source link

Auto-exclude folders that do not contain cmake files, and add configurable exclude filters #66

Closed AutonomicPerfectionist closed 2 years ago

AutonomicPerfectionist commented 2 years ago

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