0
votes

I'm using Doxygen to generate HTML files for a C project and I have several states and warnings. I've documented the state functions and warnings in C, but I would like to extract the comment into a markdown file. I know that I can use @ref function_name to generate a link to the function where the comment will be displayed, but I want to have them gathered on the same markdown page and add additional comments that aren't suitable for the source code, without having to copy paste them manually. I've looked into the Doxygen documentation and the web but I haven't found a solution. Is there a command or other approach which could help me?

Example Code

/**
 * @brief This is a function 
 *
 * @detailed This function does stuff.
 *
 * @param bar Value that has no meaning
 * 
 * @return Another value
 */
void foo(int bar)
{
 return 0;
}

How I wish I could extract the comment in a markdown file.

@ref_doc_detailed foo()
That you could never imagine. 

The result I would like when generating the HTML files.

This function does stuff.
That you could never imagine
1
Which version of doxygen are you using? Have a look at \snippet{doc} and at the \fnalbert

1 Answers

0
votes

That sounds like you want to use @copydetails. It copies everything that is marked as detailed documentation to the location it is used.

@copydetails foo
That you could never imagine.

You might need to supply the argument list if you have multiple foo functions. There is also copybrief if you only want the brief description and copydoc if you want both.