如果使用 \code,Doxygen 不会记录 class
Doxygen doesn't document a class if \code is used
这要么是 Doxygen 中的错误,要么是我遗漏了什么。很容易重现如下:
我在 foo.h
文件中有以下 class:
class Foo {
public:
/**
* This is a comment with \code value.
*/
int bar(int value);
};
如果我使用默认配置(由 doxygen -g
命令生成)的 Doxygen(版本 1.8.17
),那么 class Foo
不会出现在生成的文件中文档。如果我简单地删除 bar
注释中的 \code
符号,那么 class 就会出现。如果我把它放回去,它又会消失等等。
这看起来像是一个错误。我错过了什么吗?
P.S.: 我使用 MacOS 10.15.4
如果有什么不同的话。
命令 \code
的用法不正确,缺少结束符 \endcode
。
还有警告:
.../aa.h:10: warning: Reached end of file while still inside a (nested) comment. Nesting level 1 (probable line reference: 4)
...
.../aa.h:10: warning: File ended in the middle of a comment block! Perhaps a missing \endcode?
更正此问题时,您将收到消息:
...aa.h:1: warning: Compound Foo is not documented.
但这很清楚,因为 class 本身没有记录。
请注意,在简短描述中使用 \code
有点奇怪,也许您还应该查看 \a
、\arg
和 \param
等命令。
这要么是 Doxygen 中的错误,要么是我遗漏了什么。很容易重现如下:
我在 foo.h
文件中有以下 class:
class Foo {
public:
/**
* This is a comment with \code value.
*/
int bar(int value);
};
如果我使用默认配置(由 doxygen -g
命令生成)的 Doxygen(版本 1.8.17
),那么 class Foo
不会出现在生成的文件中文档。如果我简单地删除 bar
注释中的 \code
符号,那么 class 就会出现。如果我把它放回去,它又会消失等等。
这看起来像是一个错误。我错过了什么吗?
P.S.: 我使用 MacOS 10.15.4
如果有什么不同的话。
命令 \code
的用法不正确,缺少结束符 \endcode
。
还有警告:
.../aa.h:10: warning: Reached end of file while still inside a (nested) comment. Nesting level 1 (probable line reference: 4)
...
.../aa.h:10: warning: File ended in the middle of a comment block! Perhaps a missing \endcode?
更正此问题时,您将收到消息:
...aa.h:1: warning: Compound Foo is not documented.
但这很清楚,因为 class 本身没有记录。
请注意,在简短描述中使用 \code
有点奇怪,也许您还应该查看 \a
、\arg
和 \param
等命令。