orzih / mkdocs-with-pdf

Generate a single PDF file from MkDocs repository.
MIT License
325 stars 76 forks source link

Exclude pages recursively #63

Closed ErikThorsell closed 3 years ago

ErikThorsell commented 3 years ago

Add get_excluded_pages() which will recursively expand user-excluded paths and return a list of all pages to be excluded. The previous implementation only looks at the exact paths provided in the mkdocs.yaml whereas this implementation will work both for excluding files and directories.

Possible improvement: get_excluded_pages() is called once per is_excluded() which in turn is called once per on_post_page(). Since self._options.exclude_pages will not change between os_post_page() calls, this is inefficient and could be an issue in very large projects. Suggestions for how to make get_excluded_pages() only run once per .pdf-generation are appreciated!

Closes #58