Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create new custom command that will add to a section in Doxygen

Tags:

doxygen

I would like to create a custom command in Doxygen similar to \fn \param or \var.

For example I would like to be able to create a \option command which I would use as follows:

/**
  \option option_1 This is the first option.
  \option option_2 This is the second option.
*/

With an output like:

     Options:
          option_1 This is the first option.
          option_2 This is the second option.




A simple substitution alias does not work. For example with this alias:

ALIASES = option="\par Options:\n" 

I get the following output:

     Options:
          option_1 This is the first option.

     Options:
          option_2 This is the second option.

Which is not what I am looking for.


BOUNTY:

If any further clarification is needed, see my question: Doxygen - Create custom command

like image 655
amicitas Avatar asked Mar 08 '11 01:03

amicitas


1 Answers

While it is not as clean as @param, you can emulate similar behavior with the following aliases:

ALIASES += options="<dl class="params"><dt>Options</dt><dd><table class="params">"
ALIASES += option{2}="<tr><td class="paramname">\1</td><td>\2</td></tr>"
ALIASES += endoptions="</table></dd></dl>"

The aliases can be used as follows to produce the output you're looking for:

/**
 * @options
 * @option{ option_1, This is the first option. }
 * @option{ option_2, This is the second option. }
 * @endoptions
 */

Note: This is HTML-centric and likely will not produce reasonable output for other formats.

like image 52
DRH Avatar answered Oct 03 '22 09:10

DRH