【问题标题】:Doxygen in-body commentsDoxygen 体内评论
【发布时间】:2012-06-26 22:13:25
【问题描述】:

我有一些代码想用 in-body cmets 来记录,如下所示:

/*! \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();
}

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

有人遇到过这种情况吗?谢谢。

【问题讨论】:

  • 我很确定 Doxygen 做不到。
  • @CatPlusPlus 是什么意思? Doxygen 哪些部分不能做?
  • 我尝试使用您的完整示例代码,它呈现得很好(作为普通文本)。看到我们有相同版本的 doxygen,您在问题中给出的示例似乎缺少一些东西。您能否用一个完整的最小示例来更新您的问题,该示例重现您所描述的问题(如果可能,使用默认配置文件)?
  • doxygen --version 只打印1.8.1。那你可以试试不同版本的 doxygen 吗?

标签: c++ doxygen


【解决方案1】:

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

对于将来阅读此问题的任何人,如果您仍需要 Markdown 支持,请注意不要在第 2 行开始评论块——立即开始 cmets。

将我的最小示例更改为:

/*! \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();
}

(请立即注意体内 cmets 的开头,而不是首先使用空行)解决了这个问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-06-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-22
    • 1970-01-01
    • 2012-09-07
    • 1970-01-01
    相关资源
    最近更新 更多