[Python] Doxygen docstring displayable in vscode

Discussão em 'Python' iniciado por Stack, Abril 25, 2025.

  1. Stack

    Stack Membro Participativo

    I have a Python code, and I recently discovered Doxygen which generates the documentation automatically from the source code. If I understood correctly, to make the generated code well detected by Doxygen, the doc string should be like this :

    def f(self, x, y):
    """!Compute the sum

    @param x first number
    @param y second number
    @return sum of x and y
    """
    return x + y


    But with Vscode, the snippet, when I pointto this method, is no longer displayed correctly (cf Fig. 1)

    When I enter the docstring in this format

    """Compute the sum

    Parameters
    ----------
    x : int
    first number
    y : int
    second number

    Returns
    -------
    int
    sum of x and y
    """


    it is correctly displayed in VScode (Fig. 2)

    [​IMG] [​IMG]

    But with this second method, Doxygen no longer recognizes the parameters, and in the generated HTML page, the docstring is just displayed in verbatim mode (like with three ` in markdown)

    Is there a way to combine both ways? So that Doxygen correctly catches the parameters as well as VSCode?

    Continue reading...

Compartilhe esta Página