Difference between sphinxcontrib.napoleon and numpy.numpydoc

I am writing documentation for a Python project using docstrings in the style of < .

numpydoc and napoleon are two Sphinx Extensions that process Numpy-style docstrings to generate documentation. The first is used for the Numpy project itself, the second is Sphinx.

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

+5
source share
1 answer

The resulting format of each bit is slightly different, and the default behavior of napoleon is related to the known data types in the python documentation and it is a bit condensed ( numpydoc bit like it appears in the documentation line). Below are examples of each using the default sphinx theme.

The problem in astropy tracking issues, which states napolean , is a tight dependency for IPython , and they have migrated from numpydoc to napolean .

They mention that it has more stringent syntax requirements, but I have not tested too much to comment on this.


napoleon


enter image description here


numpydoc


enter image description here

+3
source

Source: https://habr.com/ru/post/1247423/


All Articles