2 ms·
Sphinx reads comments starting with #: above class variables and uses them for documentation. I wonder why they didn’t take the same approach here and invented
by WhyNotHugo 1y ago
Sphinx reads comments starting with #: above class variables and uses them for documentation.
I wonder why they didn’t take the same approach here and invented a new syntax.
- burntsushi 1y agoSphinx is the one who invented new syntax. I just used the syntax Python already had for docstrings, but extended it to variables. Also, when I first wrote pdoc, it was at a time of immense frustration with both Sphinx and reST.
- stuaxo 1y agoBoth sound good, it seems like # immediately above a variable should be the first fallback.
- hk__2 1y agoComments are not included in the AST. Also, Sphinx does support that syntax: https://stackoverflow.com/a/31764368/735926 https://stackoverflow.com/a/31764368/735926