views:

323

answers:

1

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" list, 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?

+1  A: 

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)

mouviciel