开发者

Adding a custom command in doxygen [duplicate]

This question already has answers here: Custom tags with Doxygen (3 answers) Closed 4 years ago.

I'd like to add a custom command to my doxygen documentation. Basically for each C function I'm writing doc for, I need to write which global variables are "touched" in read mode or write mode. It's like the "See also" lis开发者_高级运维t, just with a different caption.

In my file I'd like to write something like this:

/*
 * \read-globals   #var1, #var2
 *
 * \write-globals  #var3
 */

I tried with an alias like this:

read-globals = \par <b>Globals read</b>\n

It works but I fear that it's style sheet independent: If tomorrow I'll want to change css, then this custom command will generate output which looks different from seealso, author and all other sections.

Basically I just want to copy the format from other standard commands.

Another option is to use to the \xrefitem command, which works too, but it requires to introduce a section as second parameter which is totally useless in my case (maybe it can be hidden somehow?).

Is there a "right way" to achieve my goal?


You can combine \xrefitem and ALIASES if you want to hide the second parameter. Here is an example I use for requirements:

ALIASES += "req=\xrefitem req \"Requirement\" \"Requirements\" "

Then in documented code:

/// \req #42 The system shall work in any situation

(from my answer to that question: Custom tags with Doxygen)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜