如何在Sphinx中为Python模块的方法添加超链接?

5 投票
1 回答
1633 浏览
提问于 2025-04-16 22:58

在使用Sphinx写文档的时候,我知道可以通过Intersphinx来链接到一个类:

:py:class:`logging.Logger`

但是我想知道,怎么才能直接链接到一个特定的方法,比如logging.Logger.warning()呢?

1 个回答

12

只需要使用

:py:meth:`module.class.mymethodname`

撰写回答