phev8
phev8

Reputation: 3783

Sphinx: Remove package and module name for specific function

My question is very similar to the one here: Remove package and module name from sphinx function

Is there a way to remove/hide package and module names in sphinx only for a single function or at least for each function in a file (basically changing the global conf.py settings locally), meanwhile they are displayed for the rest of the project?

I've looked for options, like the ones for automodule (:members:, :undoc-members: etc.), but I couldn't find any directive to hide this information.

Upvotes: 2

Views: 1716

Answers (1)

Steve Piercy
Steve Piercy

Reputation: 15095

One option is to use reST markup for cross referencing syntax like so:

If you prefix the content with ~, the link text will only be the last component of the target. For example,

:py:meth:`~Queue.Queue.get`

will refer to Queue.Queue.get but only display get as the link text.

Upvotes: 3

Related Questions