31

it's any way to remove the package and or module name from sphinx doc?

Example: if exist a function called waa inside the module foo.bar, the rst code

.. automodule:: foo.bar
    :members:

will generate

foo.bar.waa()

and i want to output

waa()
barryhunter
  • 20,709
  • 3
  • 29
  • 43
JuanBC
  • 313
  • 3
  • 6

1 Answers1

47

You can change add_module_names to False in the file conf.py:

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
add_module_names = False

Then foo.bar.my_function() will display as my_function().

Maggyero
  • 4,569
  • 3
  • 30
  • 49
Cole
  • 1,619
  • 1
  • 17
  • 21
  • 2
    is there a way to do this per-automodule, rather than at the conf.py level? – 001001 May 19 '20 at 22:49
  • 1
    This does it for the function/module/class itself, but not for arguments with type annotations. See https://stackoverflow.com/q/51394955/965332 – erb Jul 15 '20 at 07:57