将napoleon/sphinx文档字符串转换为html的包装器。

napoleon2html的Python项目详细描述


拿破仑2html

https://badge.fury.io/py/napoleon2html.pnghttps://pypip.in/d/napoleon2html/badge.png

此项目包含封装sphinx或 Napoleon文档字符串到HTML。

文件

有三个函数,可以使用:napoleon_to_sphinx()sphinx_to_html()napoleon_to_html()

拿破仑到狮身人面像()

此函数可以获取Napoleon格式的文档并将其转换为sphinx。

用法:

napoleon2html.napoleon_to_sphinx("""
    Description of function

    Args:
        argument (str): Description of argument.

    Returns:
        int: Description of return.
""")

输出:

Description of function

:Parameters: **argument** (*str*) --
             Description of argument.

:returns: *int* --
          Description of return.

狮身人面像到HTML()

然后是sphinx_to_html(),它将sphinx格式的字符串转换为html:

napoleon2html.sphinx_to_html("""
    Description of function

    :Parameters: **argument** (*str*) --
                 Description of argument.

    :returns: *int* --
              Description of return.
""")

输出:

<blockquote>
<p>Description of function</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>argument</strong> (<em>str</em>) --
Description of argument.</td>
</tr>
<tr class="field"><th class="field-name">returns:</th><td class="field-body"><em>int</em> --
Description of return.</td>
</tr>
</tbody>
</table>
</blockquote>

拿破仑到HTML()

最后一个函数是napoleon_to_html(),它将前两个函数包装起来。

更改日志

0.2.0

  • Fixed bug in MANIFEST.in.

0.1.0

  • Project created.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
box api如何使用box Java SDK从图像文件中获取特定大小的缩略图?   java无法从JNA使用python cffi调用DLL中定义的函数   java在linux中通过Jar文件发送电子邮件   使用lucene+hibernate的java查询时间连接   java在带有循环的arrayList中设置值   java为什么ImageReader返回错误的BuffereImage?   c#TCP数据有时接收顺序错误且不完整   java如果发生IOException,该InputStream是否会正确关闭?   tcp在Java中,如果不使用IP,如何获取MAC地址?   java从批处理方法调用中收集结果   java Android Studio RecyclerView在滚动图像时严重滞后   java如何使用OOP进行retrofti调用?   记录FileAppender在Java中如何工作   与S3连接期间收到java异常   java找不到JNDI资源Tomcat 7