Sphinx Napoleon Extension: document multiple return arguments with Google Style docstrings
Asked Answered
C

2

7

This question is related to this other one. The proposed and accepted solution is:

Returns:
       (tuple): tuple containing:                        
                    arg1: First Argument
                    arg2: Second Argument

This solution is not working, at least for me. The indented sub-block with arg1 and arg2 description is not parsed.

How should I manage multiple returns with sphinx, sphinx.ext.napoleon and Google Style docstring?

Cyclostome answered 14/7, 2015 at 17:59 Comment(2)
I think that it's a duplicate of this post.Dropper
For posterity, the second, unaccepted answer on the other thread works fine.Guy
B
0

This is a known issue that won't be fixed by the sphinx project (current maintainers of napoleon). As mentioned at the link, they don't consider multi-line returns a part of google spec and won't fix this.

Breathy answered 14/3, 2017 at 20:35 Comment(1)
updated the above to point to issue in sphinx repo. they won't fix thisBreathy
F
0

Try to use use the newline character \n in your docstring:

Returns:
    tuple: tuple containing:

        servers (list): servers to use \n
        msg (str): logging message string 
Fargone answered 10/1, 2021 at 6:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.