Title: bug: `filters: []` not usable when `group_by_category` is set to `false` · Issue #324 · mkdocstrings/python · GitHub
Open Graph Title: bug: `filters: []` not usable when `group_by_category` is set to `false` · Issue #324 · mkdocstrings/python
X Title: bug: `filters: []` not usable when `group_by_category` is set to `false` · Issue #324 · mkdocstrings/python
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: pyt...
Open Graph 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. plugi...
X Description: To Reproduce Here is a simple module with a public and a protected function. def test(): """test.""" pass def _test(): """_test.""" pass ...
Opengraph URL: https://github.com/mkdocstrings/python/issues/324
X: @github
Domain: redirect.github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug: `filters: []` not usable when `group_by_category` is set to `false`","articleBody":"### To Reproduce\nHere is a simple module with a public and a protected function.\n```\ndef test():\n \"\"\"test.\"\"\"\n pass\n\ndef _test():\n \"\"\"_test.\"\"\"\n pass\n```\n\nOther options can be set to default values as follows.\n```yaml\nplugins:\n - mkdocstrings:\n default_handler: python\n handlers:\n python:\n options:\n group_by_category: false\n filters: []\n```\n\nThen, the `_test()` method is not appeared in the generated document.\n\n### Full traceback\n\u003cdetails>\u003csummary>Full traceback\u003c/summary>\n\n```python\nDEBUG - mkdocstrings_handlers: python\\templates\\material\\function.html.jinja: Rendering mod.test.test\nDEBUG - mkdocstrings_handlers: python\\templates\\material\\signature.html.jinja: Rendering signature\nDEBUG - mkdocstrings_handlers: python\\templates\\material\\docstring.html.jinja: Rendering docstring\n\n# the following lines won't appear if `group_by_category` is set to `false`\nDEBUG - mkdocstrings_handlers: python\\templates\\material\\function.html.jinja: Rendering mod.test._test\nDEBUG - mkdocstrings_handlers: python\\templates\\material\\signature.html.jinja: Rendering signature\nDEBUG - mkdocstrings_handlers: python\\templates\\material\\docstring.html.jinja: Rendering docstring\n```\n\n\u003c/details>\n\n### Expected behavior\n\u003c!-- Please provide a clear and concise description of what you expected to happen. -->\n\n### Environment information\n- __System__: Windows 10\n- __Python__: cpython 3.10.11\n- __Environment variables__:\n- __Installed packages__:\n - `mkdocstrings-python` v2.0.0\n\n### Additional context\nI have tried to pinpoint the issue in `children.html.jinja`, and find the following lines:\n```python\n{% if config.group_by_category %}\n... irrelevant codes here ...\n {% else %}\n\n {% for child in obj.all_members\n |filter_objects(\n filters=config.filters,\n members_list=members_list,\n inherited_members=config.inherited_members,\n keep_no_docstrings=config.show_if_no_docstring,\n )\n |order_members(config.members_order, members_list)\n %}\n\n {% if not (obj.is_class and child.name == \"__init__\" and config.merge_init_into_class) %}\n\n {% if config.filters == \"public\" or members_list is not none or child.is_public %}\n ... rendering codes here ...\n {% endif %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n```\n\nI 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:\n```python\n{% if config.filters == \"public\" or members_list is not none or (not child.is_imported or child.is_public) %}\n```\n\nAfter adding these lines, the problem will be resolved on my device.","author":{"url":"https://github.com/T0nyX1ang","@type":"Person","name":"T0nyX1ang"},"datePublished":"2025-12-03T09:56:23Z","url":"https://github.com/mkdocstrings/python/issues/324"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cd823d46-e523-1c37-a075-ae1f5fcdb3fc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 87EA:2B40B8:555D52:7709C6:6AF857E8 |
| html-safe-nonce | 56e89a3633f4ef51145c315ab970f217448c7a2fdf1a632cbbb01e3d5d907cc7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4N0VBOjJCNDBCODo1NTVENTI6NzcwOUM2OjZBRjg1N0U4IiwidmlzaXRvcl9pZCI6Ijc5ODE4ODIwOTM1ODEzOTE4NDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 613c3a2d9b6af851b7e462a1d50aa943d5daed9db2854f69afa2a8859c7b2338 |
| hovercard-subject-tag | issue:3689417943 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/mkdocstrings/python/324/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c7b2e4de4cb50b92c6c149b0526f464eb84aa81478d2d38a702b71c379feae7b/mkdocstrings/python/issues/324 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c7b2e4de4cb50b92c6c149b0526f464eb84aa81478d2d38a702b71c379feae7b/mkdocstrings/python/issues/324 |
| og:image:alt | 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. plugi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | T0nyX1ang |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5713ecd83001b2f55c3509fb7a292bf7d66d0f167c7ae87a9f7eaec5a52bf8db |
| turbo-cache-control | no-preview |
| go-import | github.com/mkdocstrings/python git https://github.com/mkdocstrings/python.git |
| octolytics-dimension-user_id | 75664361 |
| octolytics-dimension-user_login | mkdocstrings |
| octolytics-dimension-repository_id | 422878404 |
| octolytics-dimension-repository_nwo | mkdocstrings/python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 422878404 |
| octolytics-dimension-repository_network_root_nwo | mkdocstrings/python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 653be32ff5c755082a4db662491bfbbcfc9112c1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width