Doxygen - Create custom command

2019-07-23 17:39发布

I think my question is basically the same as this one, but it didn't get a good answer: Create new custom command that will add to a section in Doxygen

I pretty much want to do the same thing, I think. I want to completely duplicate the exact functionality of the @param option, except to give it the heading "Options" instead of "Parameters". I want the arguments to be the same (data type, variable name, and description) and want them to look all the same and everything. Literally, the only thing I need different is the heading.

I also tried doing this:

ALIASES = option"\par Options:\n"

in my Doxyfile, but I also get each individual option in its own section instead of all of them being in the same section. They also don't have the same arguments as the @param option.

I also tried to do something with \xrefitem which, of course, didn't work. I tried this:

ALIASES = option="\xrefitem param \"Option\" \"Options\" "

but it looks like \xrefitem is used for creating something more like a compiled list from different sections, like the Todo list.

Help is greatly appreciated. Thanks!


EDIT:

Just to clarify, the output I'm looking for would look something like this:

Options:
    string    $option1  This is option 1.
    string    $option2  This is option 2.

2条回答
在下西门庆
2楼-- · 2019-07-23 18:13

The closest I was able to come up with was to use this:

@par Options:
@li @e string @b $option1 This is option 1.
@li @e string @b $option2 This is option 2.

This almost works decently, except that it doesn't line up each part nicely, like it does with @param. So if the first option's name is something like $option1 and the second option's name is $thisIsTheSecondOption, the beginning of the descriptions will not be lined up. It looks more like:

Options:
    string  $option1 This is option 1.
    int  $thisIsTheSecondOption This is option 2.

Which makes it more difficult to read.

:-\

查看更多
【Aperson】
3楼-- · 2019-07-23 18:24

I am pretty sure that this is not possible without modifying doxygen. I would just use \li and list the options insteand of using \param then.

http://www.doxygen.nl/manual/commands.html#cmdli

查看更多
登录 后发表回答