model-diagnostics icon indicating copy to clipboard operation
model-diagnostics copied to clipboard

Make mkdocstrings filters work

Open lorentzenchr opened this issue 2 years ago • 2 comments

Currently, the mkdocstrings filters in mkdocs.yml does not work (as I would expect). The files for generating the API Reference page are currently filtered in gen_ref_pages.py.

lorentzenchr avatar Apr 14 '23 12:04 lorentzenchr

@lorentzenchr Could you please elaborate more on your need? When looking at the "filters" option https://mkdocstrings.github.io/python/usage/configuration/members/#with-filters-hello it seems to me that it is used to include/exclude Python objects rather than files.

m-maggi avatar Oct 31 '23 20:10 m-maggi

But filenames translate to python (sub) modules and I'd like to filter those and couldn't get it to work as needed. Instead, gen_ref_pages.py has

set(Path("src").rglob("*.py"))
    - set(Path("src").rglob("*tests/*.py"))
    - set(Path("src").rglob("_*/*.py"))
    - set(Path("src/").rglob("__about__.py"))

which does it's job, but doesn't seem like a nice solution to me.

lorentzenchr avatar Oct 31 '23 21:10 lorentzenchr