Doxygen - Create custom command

吃可爱长大的小学妹 提交于 2019-12-13 01:48:58

问题


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.


回答1:


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.

:-\




回答2:


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



来源:https://stackoverflow.com/questions/6984927/doxygen-create-custom-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!