athackst / mkdocs-simple-plugin

Build documentation files inside your code into a MkDocs site.

Home Page:https://althack.dev/mkdocs-simple-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

v2.1.1 no longer seems to ignore_folders

gwhitney opened this issue · comments

Again in the process of attempting to update mkdocs_semiliterate, this time to v2.1.1 (which is OK with a single extract block, thanks), I am finding that if I for example have 'tests' in my ignore_folders parameter, files in my tests/ directory are still being scanned. The change seems to be that in prior code, the file tree was walked in Simple.build_docs and the loop included the line:

                directories[:] = [
                    d for d in directories if not self.is_ignored(root, d)]

but now the file tree is walked in Simple.get_files and the apparently corresponding loop has no filter on directories. Please let me know how I can assist with this situation.

It should filter directories.

ref

        # Check for ignore folder in patterns
        if any(fnmatch.fnmatch(base_path, filter)
                for filter in self.ignore_glob):
            return True

You need to use a glob pattern that will work from the base directory.

Well, I have a top-level directory named tests and I have the string tests as one of the entries in ignore_folders, and yet tests/fixtures/extract-inclusion/README.md is being scanned, which it was not before. tests surely matches tests, so I believe I am specifying that the top-level tests folder should be ignored, and yet it seems to be walked... Should I provide a complete example of such a project tree? If so, what's the most convenient way for you?

Ah, I see the issue.

I'll throw up a fix.

I could be wrong but it seems to me that the new test you wrote never creates a goo/night.md file and so isn't really testing that such a file is ignored... just thought I'd mention.

bah. Thanks!