如何在Doxygen中为示例程序页面添加标记?

如何在Doxygen中为示例程序页面添加标记?,doxygen,Doxygen,我有一套Doxygen生成的库文档,包括示例程序。它们很好地显示在结果文档的“示例”选项卡下。我想在这些页面中添加一些Doxygen类型的标记,但不知道如何做。所有标记注释都将被删除,并且不会显示在Doxygen输出中的任何位置。我希望包括一些描述性的段落,也许还有一组用户可以查看的程序输出。我目前的解决办法是将所有这些权利作为非Doxygen注释包含在源代码中。这种方法是有效的,但它不是我所希望的 /** * \brief ATTEMPTED DESCRIPTION * * I w

我有一套Doxygen生成的库文档,包括示例程序。它们很好地显示在结果文档的“示例”选项卡下。我想在这些页面中添加一些Doxygen类型的标记,但不知道如何做。所有标记注释都将被删除,并且不会显示在Doxygen输出中的任何位置。我希望包括一些描述性的段落,也许还有一组用户可以查看的程序输出。我目前的解决办法是将所有这些权利作为非Doxygen注释包含在源代码中。这种方法是有效的,但它不是我所希望的

/** 
 *  \brief ATTEMPTED DESCRIPTION
 *
 *  I would like to include some kind of markup on the example page for 
 *  this program.  I link to it just fine from one of my library routines,
 *  the the Doxygen-generated example page just shows all of this verbatim.
 *
 *  Is there any way to provide some kind of section where I can discuss
 *  the example program itself?  And potentially provide sample output
 *  and the like?  (I realize that doesn't make sense for "Hello World",
 *  but you get the idea.)
 */

#include <iostream>

int main ( int argc, char *argv[] )
{
    std::cout << "Hello World" << std::endl ;

    return 0 ;
}
/**
*\简要描述
*
*我想在示例页面上添加一些标记,以供参考
*这个节目。我从我的一个库例程链接到它,
*Doxygen生成的示例页面只是逐字显示了所有这些内容。
*
*有没有办法提供一些我可以讨论的部分
*示例程序本身?并可能提供样本输出
*诸如此类?(我意识到这对“你好世界”来说没有意义,
*但是你明白了。)
*/
#包括
int main(int argc,char*argv[])
{

std::cout在上个月探讨了这个问题之后, 我已经确定您不能有效地更改doxygen的输出 在示例程序文件中使用标记

解决方案是在文档中构建一个单独的页面, 使用
\include
指令包含示例代码,然后 手动提供指向此新示例页面的链接 在上面,使用以下格式创建一个文件并使用
\include
指令用于添加示例中的实际代码 然后,添加一个叙述和一个章节就很简单了 程序输出

在本例中,使用以下结构创建文件
example hello world.dox

/*! \page  ex-page Example Program Page
 *
 *  \brief Example code for the "hello world" program.
 *
 *  \section ex-sec-description Program Details
 *
 *  In order to display the string "Hello World" to the standard output
 *  stream, the user should use the `std::cout` stream provided by C++.
 *
 *  \include example_hello_world.cpp
 *
 *  \section ex-sec-output Program Output
 *
 *  The program above will generate the following output when executed.
 *
 *            Hello World
 */

是否尝试了\snippet命令?