简体   繁体   English

Doxygen 对 Python 中声明的行尾注释

[英]Doxygen end of line comments on declarations in Python

In C/C++, you can force doxygen to recognize that a comment applies to the text preceding it on a line.在 C/C++ 中,您可以强制 doxygen 识别注释适用于一行上它之前的文本。 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 .将字符串添加到my_variable的文档中。 Trying the equivalent in Python doesn't seem to work.在 Python 中尝试等效项似乎不起作用。 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_other_variable ,但这两个:

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?有没有办法在 Python 中做相当于//!<的方法?

No, at the moment this is not supported.不,目前不支持此功能。

The parser for Python was provided by a couple of students. Python 的解析器由几个学生提供。 While they did a good job overall, they did not implement all the features that are available for C/C++.虽然他们总体上做得很好,但他们并没有实现 C/C++ 可用的所有功能。

Two most notable features that are missing are:缺少的两个最显着的功能是:

Hopefully I get around to add these in the future, but any help is welcome.希望我将来可以添加这些,但欢迎提供任何帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM