17

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.

kakyo
  • 10,460
  • 14
  • 76
  • 140

2 Answers2

21

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>
albert
  • 8,285
  • 3
  • 19
  • 32
Nick
  • 1,361
  • 1
  • 14
  • 42
  • 2
    Worth noting, the CSS is used by having `HTML_EXTRA_STYLESHEET = doxygen-styles.css` in the doxygen configuration file. – Hi-Angel Jun 23 '20 at 08:31
  • 1
    Do you mean that markdown comes with the generic doxygen engine? Is it that I can just mix in markdown syntax in the main text? – kakyo Aug 11 '22 at 04:03
  • 1
    @kakyo [Doxygen supports PHP Markdown Extra and GitHub Flavored Markdown out of the box](https://doxygen.nl/manual/markdown.html) within Doxygen comment blocks. Doxygen can also process complete Markdown documents provided the file extension is .md or .markdown. Markdown documents will be turned into pages that show up under the "related pages" menu. However, there is an option to use a markdown document as the mainpage, e.g. README.md could be your mainpage in bitbuckt/github and also your doxygen output. – Nick Aug 12 '22 at 13:03
-2

Found the solution myself:

All I need to do is to escape the :: token and other similar tokens ->.

For example

\:\: 

\-\>
kakyo
  • 10,460
  • 14
  • 76
  • 140