Doxygen end of line comments on declarations in Python

大憨熊 提交于 2019-12-22 09:46:08

问题


In C/C++, you can force doxygen to recognize that a comment applies to the text preceding it on a line. Any of these:

int my_variable;                 /*!< This is my variable */
int my_variable;                 /**< This is my variable */
int my_variable;                 //!< This is my variable
int my_variable;                 ///< This is my variable

adds the string to the documentation for my_variable. Trying the equivalent in Python doesn't seem to work. This works:

## This is my variable
my_variable = None

This:

my_variable = None               ## This is my variable
my_other_variable = None

attaches the documentation to my_other_variable, as you'd expect, but both of these:

my_variable = None               ##< This is my variable
my_variable = None               #!< This is my variable

seem to just discard the documentation. Is there a way to do the equivalent of //!< in Python?


回答1:


No, at the moment this is not supported.

The parser for Python was provided by a couple of students. While they did a good job overall, they did not implement all the features that are available for C/C++.

Two most notable features that are missing are:

  • support for documenting stuff after the definition
    https://bugzilla.gnome.org/show_bug.cgi?id=361813
  • support for cross-referencing and call graphs
    http://old.nabble.com/Python-callgraph-td24224054.html

Hopefully I get around to add these in the future, but any help is welcome.



来源:https://stackoverflow.com/questions/6179305/doxygen-end-of-line-comments-on-declarations-in-python

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!