PyDsphinx文档和PopDthump文档

2024-04-23 07:32:46 发布

您现在位置:Python中文网/ 问答频道 /正文

让我们想象一下,我希望看到PyCharm4.5社区版中一个简单方法的docstring弹出窗口(也在5.0中尝试过)。在

我用epytext语法(Epydoc generator自2008年起不受支持,仅适用于Python2)和restructedText语法(Sphinx积极支持的生成器使用它,用于正式的python文档)

epytextone可以完美地在PyCharm文档弹出窗口中工作

PyCharm works with epytext Screenshot

但是structuredText一个根本不显示任何参数!在

PyCharm fails with reStructuredText Screenshot

尝试用PyCharm设置来处理这个问题,阅读PyCharm帮助,搜索PyCharm bugtracker并使用Google都无法帮助我找到PyCharm中这些docstring弹出窗口不能与社区推荐的docstring标记语言一起正常工作的原因。在

因为这个功能需求低?也许,在PyCharm或者其他IDE中,是否有一些有用的替代方法来查看现代文档标记?我还需要能够生成HTML格式的文档页。在

我在这里发现了another topic,与同一个问题有关,但自去年以来仍然没有答案。所以,我想在现代IDE中查看现代文档的愿望有什么问题。在

下面是我的代码示例

def find_links(self, issue, link_type):
    """

    Find all issues linked with C{issue} with C{link_type}.

    @param issue: Issue key
    @type issue: str
    @param link_type: Accepts either Type Name (like 'Child') or Link Description (like 'child of')
    @type link_type: str
    @return: Keys of found issues
    @rtype: list

    """
    result_keys = []
    link_list = self.get_link_list(issue)
    for link in link_list:
        ... # omitted
    return result_keys

def test_sphinx_docs_method(self, issue, link_type):
    """

    Find all issues linked with *issue* with *link_type*.

    :param issue: Issue key
    :type issue: str
    :param link_type: Accepts either Type Name (like 'Child') or Link Description (like 'child of')
    :type link_type: str
    :return: Keys of found issues
    :rtype: list

    """
    result_keys = []
    link_list = self.get_link_list(issue)
    for link in link_list:
        ... # omitted
    return result_keys

Tags: of文档selfreturnparamtypewithlink
1条回答
网友
1楼 · 发布于 2024-04-23 07:32:46

我不知道这个特性是否只出现在最近的PyCharm版本中,那么你有什么版本?在我的PyCharm CE 2016.2.2中,它看起来像屏幕截图。在

enter image description here

选中“首选项”>;“编辑器”>;“常规”>;“代码完成”,以确保“自动停止文档”选项已启用。在

祝你好运!在

相关问题 更多 >