> Hi! I'm using sphinx==3.1.1. I have a package `foo` with a subpackage `bar`. 
> I also have a class :class:`foo.bar.Bar`.
> Is there any way to create references to `Bar` as :class:`Bar`, not as 
> :class:`foo.bar.Bar` ?

If you want to write "foo.bar.Bar" but only display "Bar":

:class:`~foo.bar.Bar` (note the "tilde" character)

If you want to write "Bar":

.. currentmodule:: foo.bar

:class:`Bar`

Does that help?

cheers,
Matthias

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/CAFesC-c8-mVTVDYChomgjBdaE1y4jQBW4K%2BHRMOVhRkTrwYTqQ%40mail.gmail.com.

Reply via email to