Adding a custom command to doxygen

I would like to add a custom command to my doxygen documentation. Basically, for every C function I write doc with, I need to write which global variables β€œtouch” in read or write mode. This is similar to the See Also list, with a different heading.

In my file, I would 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 

This works, but I'm afraid this style sheet is independent: if I want to change css tomorrow, then this user command will generate output that looks different than, for example, the author and all other sections.

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

Another option is to use the \ xrefitem command, which also works, but you need to enter the section as the second parameter, which in my case is completely useless (maybe it can be hidden somehow?).

Is there a β€œright way” to achieve my goal?

+4
source share
1 answer

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

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

Then in the documented code:

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

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

+4
source

All Articles