Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate inline code section with Doxygen?

My narration has code snippets, e.g., ::SomePlatformAPI() that are not part of my code base and Doxygen warns that

warning: explicit link request to 'SomePlatformAPI()' could not be resolved

I tried to add \code and \endcode around it but then the code block starts a new paragraph and breaks the current narration.

Is there a way to add inline code blocks?

UPDATE:

This turns out to be only a problem of Doxygen 1.8 and above. With 1.6, you don't have this issue.

like image 263
kakyo Avatar asked Jul 12 '13 16:07

kakyo


People also ask

How do I show code in doxygen?

You can put example source code in a special path defined in the doxygen config under EXAMPLE_PATH , and then insert examples with the @example tag. Doxygen will then generate an extra page containing the source of the example. It will also set a link to it from the class documentation containing the example tag.

How do I add a new line in doxygen?

Add \n followed by a space at the end of your line [1]. Especially recommended when editing with Emacs, which reacts in weird ways to the other suggested solution <br> . [1] As per @albert's comment. Works for me under Doxygen 1.8.

Can doxygen generate markdown?

Doxygen is a well-known tool for generating documentation directly out of the annotated source code. However, it can be utilized to create technical documentation, too. In version 1.8. 0, Markdown support was introduced to Doxygen.


1 Answers

Doxygen markdown support allows you to insert inline code blocks using the ` backtick character. http://www.doxygen.nl/manual/markdown.html#md_codespan

When you do this the code will be injected inline, but it will be monospaced, and doxygen processing will be disabled between the two ` marks. So you will not have to escape tokens.

A a matter of fact, to make it stand out even more I included an extra style sheet with the following in it:

code
{
    background-color:#EFD25E;
}

That will hylight the inline code. Doxygen's code spans use a custom tag

<code></code>
like image 147
Nick Avatar answered Oct 09 '22 05:10

Nick