【发布时间】:2015-02-18 23:48:28
【问题描述】:
我需要生成包含引用块编号列表的文档,其中包含标记、递增数字和实际代码块(最好带有链接)。我至少可以处理一个标签、唯一编号和一个真正的代码块。
所以拿这个:
C++ 代码:
int a = 5;
int b = 10;
int c, d;
/**
* @method{} Multiply
*/
c = a*b;
/** @endmethod */
/**
* @method{} Divide
*/
d = a/b;
/** @endmethod */
并将其转换为“相关页面”下名为“方法”的 Doxygen 页面,其中列出了这两种方法以及标题,类似于:
Doxygen 输出 - 相关页面 - 方法:
Function foobar
Method 1: Multiply <-- {} First argument turns to a number?
c = a*b; <-- More important: This gets pulled from the code?
Method 2: Divide
d = a/b;
也许有更好的工具来解决这个问题?
到目前为止,我已经通过将此别名添加到 Doxyfile 中,使用我的 cmets 在“相关页面”下生成“方法”页面:
Doxyfile:
ALIASES += "method=\xrefitem method \"Method \" \"Methods\" "
但我无法找到一种方法来获取实际代码以插入到文档中...或者如何自动或手动对其编号(我可以预处理)...我得到的最接近的是 @code 和 groups 是 hacky 并且不起作用?
【问题讨论】:
标签: c++ documentation comments doxygen