Doxygen体内评论

And*_*Lee 8 c++ doxygen

我有一些代码,我想用体内注释来记录,如下所示:

/*! \file best.cpp
 *  \brief The best
 *
 *  I am the best
 */

/*! \fn void theBestFunction(int)
 * I'm the best blah blah blah
 */
void theBestFunction(int ever)
{
    doThings();
    /*!
     * Does some more things
     */
    doMoreThings();
    /*!
     * Checks that the things it does are the best
     */
    checkBest();
}
Run Code Online (Sandbox Code Playgroud)

但是当我运行时doxygen,它似乎将内部块格式化为代码片段,就好像使用了@code或者\code命令(它们不是).我希望将体内注释格式化为普通文本.

以前有人遇到过这个吗?谢谢.

And*_*Lee 7

我设法解决了这个问题.事实证明,Doxygen以某种方式将这些块处理为相互缩进,而Markdown中的缩进(很像StackOverflow)表示代码块(http://en.wikipedia.org/wiki/Markdown#Code) .我只是关闭了Markdown并解决了问题.

对于将来阅读此问题的任何人,如果您仍需要Markdown支持,请注意不要在第二行开始注释块 - 立即开始注释.

将我的最小示例更改为:

/*! \fn void theBestFunction(int)
 * I'm the best blah blah blah
 */
void theBestFunction(int ever)
{
    doThings();
    /*! Does some more things
     */
    doMoreThings();
    /*! Checks that the things it does are the best
     */
    checkBest();
}
Run Code Online (Sandbox Code Playgroud)

(注意立即开始体内注释,而不是先写一个空白行)解决问题.