Sphinx 1.4+ and block literals in Returns with sphinx-napoleon don't work anymore

508 Views Asked by At

I am writing documentation for a python project that follows this guide:

http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html

To be exact this part of the guide:

The Returns section supports any reStructuredText formatting, including literal blocks::

My code looks as follows:

Returns:
    None:

    ::

        {
            "status": "update",
            "success": True,
        }

For sphinx 1.3.5-1.3.6 it works as expected.

For sphinx 1.4.0-1.4.1 it throws error like that:

api/v0_0/views.py:docstring of api.v0_0.views.add_gallery:19: ERROR: Unexpected indentation.
api/v0_0/views.py:docstring of api.v0_0.views.add_gallery:21: WARNING: Block quote ends without a blank line; unexpected unindent.
1

There are 1 best solutions below

0
On BEST ANSWER

This was bug. I have created a ticket with working example how to reproduce it. Guys working on Sphinx have fixed it week (or so) later. Bumping version will solve it.