mkdocstrings / python

A Python handler for mkdocstrings.
https://mkdocstrings.github.io/python
ISC License
190 stars 35 forks source link

feature: Add option to filter out imported objects (true by default for backward compatibility) #170

Open pawamoy opened 5 months ago

pawamoy commented 5 months ago

Is your feature request related to a problem? Please describe.

Not really, it's rather a refactoring issue. Currently the templates use filter_objects first, then do a second pass with {% if members_list is not none or attribute.is_public %}. The next version will use Griffe 0.47's is_imported (negated) instead, but that makes it hard to follow. We should move this logic into the filter_objects filter, with a config option like show_imported_objects or similar name.

Describe the solution you'd like

New config option passed to filter_objects to decide whether to filter out imported objects or not.

Describe alternatives you've considered

/

Additional context

https://github.com/mkdocstrings/griffe/issues/294

Boost priority

Fund with Polar