'How do I exclude modules from autosummary recursive documentation

I have some Sphinx docs like so:

Browse the code-based documentation here:

.. autosummary::
   :toctree: _autosummary
   :template: custom-module-template.rst
   :recursive:

   foo

Where foo is a module which has foo.bar, foo.bar.a, foo.baz, etc. Is there a way to exclude foo.baz?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source