【问题标题】:Simple way to convert Python docstrings from reStructured Text to Google style?将 Python 文档字符串从 reStructured Text 转换为 Google 样式的简单方法?
【发布时间】:2017-07-06 17:22:03
【问题描述】:

现在有没有人用一种简单的方法将现有项目中的所有文档字符串从 reStructured Text 转换为 Google format

看起来Napoleon 可以做类似的事情,但看起来很复杂,所以我想我会问是否有人以前做过。任何想法将不胜感激。

【问题讨论】:

    标签: python python-sphinx docstring google-style-guide sphinx-napoleon


    【解决方案1】:

    尝试使用pyment 将文档字符串从 reStructuredText 转换为 Google 格式。然后使用 Napolean 通过 Sphinx 生成文档。

    Napoleon 是一个预处理器,它解析 NumPy 和 Google 样式的文档字符串,并在 Sphinx 尝试解析它们之前将它们转换为 reStructuredText。

    【讨论】:

    • 您提供的链接给出了 404。
    • Then use Napolean to generate documentation via Sphinx. 不是问题的一部分。但是感谢您提供的信息,因为 Sphinx 无法直接接受 google 样式。
    • @LukAron OP 说“看起来拿破仑可以做这样的事情”。我在回答中详细说明了何时使用拿破仑,特别是在使用 pyment 之后。
    猜你喜欢
    • 1970-01-01
    • 2013-09-16
    • 2010-12-21
    • 1970-01-01
    • 1970-01-01
    • 2012-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多