Difference between sphinxcontrib.napoleon and numpy.numpydoc

I am writing documentation for a Python project using Numpy-style docstrings.

numpydoc and napoleon are two Sphinx extensions that parse Numpy-style docstrings to generate documentation. The first one is used for the Numpy project itself, the second is shipped with Sphinx.

What are the pros and cons of using one extension over the other?


The resulting format of each a bit different, and the default behavior of napoleon links to known datatypes in the python documentation, and it is slightly more condensed ( numpydoc displays a bit like how it appears in the docstring). Below are examples of each, both using the default sphinx theme.

An issue in astropy 's issue tracker that states napolean is a hard dependency for IPython , and they have since migrated from numpydoc to napolean .

They mention it has stricter syntax requirements, but I haven't tested either too much to comment on that.


napoleon


在这里输入图像描述


numpydoc


在这里输入图像描述

链接地址: http://www.djcxy.com/p/91416.html

上一篇: 将多项式拟合到函数的最大值

下一篇: sphinxcontrib.napoleon和numpy.numpydoc之间的区别