I have multiple modules in my package
.
package/
|--mod1.py
|--mod2.py
Each module contains some functions
and a test_function
for testing the module.
I am using sphinx-apidoc
to generate the .rst
files for every module
in package
. My problem is that when I am generating documentation for my package, the test
functions are also getting included in the documentation. I know it is possible to skip functions by using: :exclude members: function
. But I'm looking for a solution that will allow me to do that for all modules by using a pattern similar to test_*
.
My package.rst
file looks like this:
package package
===============
Submodules
----------
.. toctree::
package.mod1
package.mod2
Module contents
---------------
.. automodule:: package
:members:
:undoc-members:
:show-inheritance:
And my mod1.rst
file looks like this:
package.mod1 module
===================
.. automodule:: package.mod1
:members:
:undoc-members:
:show-inheritance:
Thanks in advance.