Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 52
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
To Reproduce
Here is a simple module with a public and a protected function.
def test(): """test.""" pass def _test(): """_test.""" pass Other options can be set to default values as follows.
plugins: - mkdocstrings: default_handler: pythonhandlers: python: options: group_by_category: falsefilters: []Then, the _test() method is not appeared in the generated document.
Full traceback
Full traceback
DEBUG-mkdocstrings_handlers: python\templates\material\function.html.jinja: Renderingmod.test.testDEBUG-mkdocstrings_handlers: python\templates\material\signature.html.jinja: RenderingsignatureDEBUG-mkdocstrings_handlers: python\templates\material\docstring.html.jinja: Renderingdocstring# the following lines won't appear if `group_by_category` is set to `false`DEBUG-mkdocstrings_handlers: python\templates\material\function.html.jinja: Renderingmod.test._testDEBUG-mkdocstrings_handlers: python\templates\material\signature.html.jinja: RenderingsignatureDEBUG-mkdocstrings_handlers: python\templates\material\docstring.html.jinja: RenderingdocstringExpected behavior
Environment information
- System: Windows 10
- Python: cpython 3.10.11
- Environment variables:
- Installed packages:
mkdocstrings-pythonv2.0.0
Additional context
I have tried to pinpoint the issue in children.html.jinja, and find the following lines:
{%ifconfig.group_by_category%} ... irrelevantcodeshere ...{%else%}{%forchildinobj.all_members|filter_objects( filters=config.filters, members_list=members_list, inherited_members=config.inherited_members, keep_no_docstrings=config.show_if_no_docstring, ) |order_members(config.members_order, members_list) %}{%ifnot (obj.is_classandchild.name=="__init__"andconfig.merge_init_into_class) %}{%ifconfig.filters=="public"ormembers_listisnotnoneorchild.is_public%} ... renderingcodeshere ...{%endif%}{%endif%}{%endfor%}{%endif%}I validate the filtering part, and the results are correct, so the problem may be inside the rendering part. Comparing with the similar codes in the if-branch, there is a significant difference in the code:
{%ifconfig.filters=="public"ormembers_listisnotnoneor (notchild.is_importedorchild.is_public) %}After adding these lines, the problem will be resolved on my device.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working