18

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.

2 Answers 2

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>
Sign up to request clarification or add additional context in comments.

3 Comments

Worth noting, the CSS is used by having HTML_EXTRA_STYLESHEET = doxygen-styles.css in the doxygen configuration file.
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 Doxygen supports PHP Markdown Extra and GitHub Flavored Markdown out of the box 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.
-1

Found the solution myself:

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

For example

\:\: 

\-\>

4 Comments

How do you escape the tokens? backslash?
@Jasper Blues Yes, it's backslash.
What's that "#"? If you were talking about "::", then you need to escape both ":" separately.
You should provide an working example for others looking for the answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.