跨狮身人面像的链接更短?

时间:2018-11-15 17:33:10

标签: python documentation python-sphinx docstring sphinx-napoleon

我试图使我的文档字符串易于阅读,并且在使用Intersphinx和Napoleon时遇到困难。我有这样的课程:

from long_import_path_one.long_import_path_two import Bar
from long_import_path_one.long_import_path_three import Baz
from long_import_path_one.long_import_path_four import Qux
from long_import_path_five.long_import_path_six import FooBar

class FooWithHorribleDocstrings(object):
    """
    Data flows out through the :py:class:`long_import_path_one.long_import_path_two.Bar`
    which owns a collection of :py:class:`long_import_path_one.long_import_path_three.Baz`
    objects that read from a :py:class:`long_import_path_one.long_import_path_four.Qux` 
    and post to the backend using the :py:class:`long_import_path_five.long_import_path_six.FooBar` 
    """

class FooWithCleanDocstrings(object):
    """
    Data flows out through the ``Bar`` which owns a collection of ``Baz`` objects
    that read from a ``Qux`` and post to the backend using the ``FooBar`` 
    """

如果我已经导入了模块,我需要完全限定的名称似乎有点可笑,但是我还没有找到一种方法来使它起作用。有什么建议吗?

0 个答案:

没有答案