nicolashainaux / sphinx-autodoc-annotation

Use Python 3 annotations in sphinx-enabled docstrings
BSD 3-Clause "New" or "Revised" License
44 stars 5 forks source link

Support napoleon and google style docs #6

Open sotte opened 8 years ago

sotte commented 8 years ago

I normally sphinx-napoleon and the "google style" for docs. It would be great if sphinx-autodoc-annotation supported this!

class MyClass: pass

def f(x: str, y: MyClass) -> str:
    """
    Do something...

    Args:
        x: some string
        y: something important

    Return:
        the same string
    """
    print(x)
    return x

Currently the output looks like this: sphinx_autodoc_annotation_napoleon

evanunderscore commented 7 years ago

Napoleon works by transforming docstrings, so this may work out of the box if you put sphinx.ext.napoleon before sphinx_autodoc_annotation. I haven't tested it, but the same thing works for sphinx-autodoc-typehints.