You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
show_category_heading: true and group_by_category: true does not work #14
The point of the any filter is actually to filter out objects that have no docstring or an empty docstring. And I realize it's actually insufficient to do it like that.
Let say show_if_no_docstring is false, and there's one function with no docstring in obj.functions.values(). Without any we would render the category header for nothing (the category is empty).
Now if show_if_no_docstring is true, we shouldn't filter out with any, and just check if there are objects.
I think we need a more powerful function on the handler's side, to do this filtering for us based on the show_if_no_docstring option. This way we won't have to resort to the any filter anymore.
Hmm.. I get it. So that function would be in the handler.py in this repo? I confess I'm not used to working with jinja and markdown that much so I'm a little green yet and trying to figure out the data flow between mkdocstrings-python and mkdocstrings. If you have any direction I can give it a go.
Activity
pedrolabonia commentedon Apr 15, 2022
Proposed fix: pedrolabonia@0772ccc
pawamoy commentedon Apr 16, 2022
The point of the
anyfilter is actually to filter out objects that have no docstring or an empty docstring. And I realize it's actually insufficient to do it like that.Let say
show_if_no_docstringis false, and there's one function with no docstring inobj.functions.values(). Withoutanywe would render the category header for nothing (the category is empty).Now if
show_if_no_docstringis true, we shouldn't filter out withany, and just check if there are objects.I think we need a more powerful function on the handler's side, to do this filtering for us based on the
show_if_no_docstringoption. This way we won't have to resort to theanyfilter anymore.pedrolabonia commentedon Apr 16, 2022
Hmm.. I get it. So that function would be in the
handler.pyin this repo? I confess I'm not used to working with jinja and markdown that much so I'm a little green yet and trying to figure out the data flow between mkdocstrings-python and mkdocstrings. If you have any direction I can give it a go.fix: Fix categories rendering
pawamoy commentedon Apr 16, 2022
Well I wanted to see how it could be done and I ended up implementing the change 😅
I hope you don't mind! Let me know what you think of #16.
pawamoy commentedon Apr 16, 2022
Also, can you confirm that the original issue was that in some cases the category headings were not rendered? It isn't clear in the description.
pedrolabonia commentedon Apr 16, 2022
In my case, I could never get them to render the category headings at all, and could never group the children by category.
My object tree consisted of basically methods, properties and attributes with a parent class.
No nesting or things like that.
fix: Fix categories rendering
pawamoy commentedon Apr 18, 2022
OK I've merged the PR. We'll need to wait for a new release of mkdocstrings before releasing one for the handler. That should'nt take too long.
fix: Fix categories rendering