How to filter which methods are included in an autosummary list?

106 views
Skip to first unread message

Connossor

unread,
May 29, 2021, 8:25:20 AM5/29/21
to sphinx-users
Hi all,

Is there a way to gather methods into groups when creating autosummary tables, using a metadata tag or something similar?

I'm working on a project with many classes each with a large number of methods. Autosummary has been super helpful to create a summary listing of the methods, but the list is really long so I need a way to separate out the most useful methods from the rest.

Currently I am using this custom template to create the autosummary table for each class:
https://github.com/bp/resqpy/blob/master/docs/_templates/custom-class-template.rst

I'm wondering if it's possible to break out the Methods section into two parts, "Most useful" and "Others"?

Perhaps this could be controlled by adding a custom metadata tag like :meta important: in the method docstrings, and having two different autosummary tables that somehow only include methods with the relevant tag?

Any tips greatly appreciated!

C

Komiya Takeshi

unread,
May 30, 2021, 12:39:00 PM5/30/21
to sphinx...@googlegroups.com
Hi,

Unfortunately, there is no way to customize (reorder, filter, and so
on) the result of autosummary. I think it's useful. So it would be
nice if autosummary will support it :-)

Thanks,
Takeshi KOMIYA

2021年5月29日(土) 21:25 Connossor <conno...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/cea3c13a-3d86-49ce-acde-7d1d0c8523e7n%40googlegroups.com.

Connor Tann

unread,
May 30, 2021, 6:18:39 PM5/30/21
to sphinx...@googlegroups.com
For anyone else with the same question, I think I have found a solution. There exists a Sphinx extension for this purpose:

In any case, I think a "filter by metadata" tab would make a useful addition to the autosummary directive.

C

You received this message because you are subscribed to a topic in the Google Groups "sphinx-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sphinx-users/9G_spP4j8qg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sphinx-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/CAFmkQAM3S5gLo3vwVuK39ivpqG7HPwFtB1sf2BDWbL7%2BQhgqkQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages