1

I'm using doxygen in combination with doxypypy to document Python source code.

class Test:
    """
    This is a test class.

    The thest class only serves the purpose of a MWE.

    Attributes:
        memberA (int): This is member A.
        memberB (int): This is member B.
        memberC (int): This is member C. A and B never invite C to their party.
    """

    def __init__(self):
        self.memberA = []
        self.memberB = []
        self.memberC = []

I now want to group members A and B in a member group (by using @{ and @} etc.) but several attempts of implementing this in the docstring were futile. What is the correct syntax of achieving this? (I'm quite new to Python in general, I'm coming from the C++ side... I'm using Google commenting style)

EDIT: Also, I failed to find out so far what formats I can use now. I know I can use doxygen special commands, but does doxypypy know how to read e.g. Google Style Doc?

EDIT2: I also discovered, that doxygen/doxypypy ignore the type hints... does anyone know how to include them?

EDIT3: Member groups can be used by using

##@{
#items in group
##@}
LCsa
  • 607
  • 9
  • 30
  • From the documentation (http://www.doxygen.nl/manual/docblocks.html#pythonblocks halfway trough the paragraph): Note that in this case none of doxygen's special commands are supported. – albert May 31 '19 at 11:22
  • As noted in my post I use `doxypypy` which is a tool to work with Python's docstrings – LCsa May 31 '19 at 11:31
  • So what is the outcome of the doxypypy and handed to doxygen? When doxypypy doesn't translate the `"""` to e.g. `"""!` the note is still valid. Btw. doxygen has also its own python scanner so no reaal need for doxypypy unless doxypypy does some translations. – albert May 31 '19 at 11:39
  • As far as I know, `doxypypy` enables (so does `doxypy`) usage of `doxygen`'s special commands inside Python's doc strings. Somewhere else I just right now saw that `"""!` you proposed and I'll immediately try. Also, the style I chose in the attribute section is still "Sphinx napoleon"ish, maybe that's also a problem? – LCsa May 31 '19 at 12:01
  • I don't know "Sphinx napoleon" so it is hard to comment on it. – albert May 31 '19 at 12:41
  • Ah, sorry, `napeolon` converts comments in Python doc strings that are written in e.g. Google Style or NumPy Style to `Sphinx`-readable restructured text – LCsa May 31 '19 at 12:44
  • Regarding the Edit2. Which doxygen version are you using? – albert Jun 11 '19 at 15:11
  • @albert It's version 1.8.15. For now I built a custom alias which allows me to use something like `@type{int}` which looks quite nice, but a built-in solution would be more elegant of course – LCsa Jun 11 '19 at 16:44
  • I read in another question that python nowadays has something like `self.memberA: int = 0` (which pep ?) in doxygen this could lead to a variable where the type of the variable is mentioned in the documentation of the variable declaration (currently not implemented in doxygen). Is this what you mean? – albert Jun 12 '19 at 08:52
  • @albert Something like that or type hints in a function call. But as I said above, I use a custom doxygen macro as a work around. – LCsa Sep 06 '19 at 20:34

0 Answers0