sphinx-contrib / napoleon

Other
149 stars 48 forks source link

Request: Handle markdown header for sections #41

Open ws1088 opened 1 year ago

ws1088 commented 1 year ago

Hi, I am using Google style docstring in vscode and would like to write docstring for vscode intellisense and sphinx to generation HTML documentations. This is a typical docstring:

def test(a:int, b:bool) -> float:
    """_summary_

    ### Args:
        `a` (int): _description_
        `b` (bool): _description_

    ### Raises:
        `ValueError`: _description_
        `ZXValueError`: _description_

    ### Returns:
        `float`: _description_
    """    

I would like to see if napoleon can treat ## Args: or ### Args: as Args section in sphinx?

Looks like the change would be here: https://github.com/sphinx-contrib/napoleon/blob/master/sphinxcontrib/napoleon/docstring.py#L36

Would you accept such change? Thanks!