5

I want to include a literal HTML element in a Doxygen comment. Something like this:

/// This function skips all <li> elements

If I write it like that, the <li> is passed to the HTML output, which is obviously not what I want.

Instead, I can write this:

/// This function skips all &lt;li&gt; elements

This works fine in the HTML generated by Doxygen, but now the comment in the source code itself is rather illegible.

So it looks like I have to choose between legibility in the generated documentation or in the source code.

Is that really the case, or is there a way to force Doxygen to automatically turn all <blabla> into &lt;blabla&gt;?

stackoverflow
  • 2,320
  • 3
  • 17
  • 21
oz1cz
  • 5,504
  • 6
  • 38
  • 58

1 Answers1

10

You could also have used:

/// This function skips all \<li\> elements

Or (if MARKDOWN_SUPPORT=YES) write:

/// This function skips all `<li>` elements

which are both reasonably readable, or put everything in a \verbatim..\endverbatim section, but then it is also rendered as such.

You could also define an an alias, i.e.

ALIASES = verb{1}="\<\1\>"

And then write

/// This function skips all \verb{li} elements
doxygen
  • 14,341
  • 2
  • 43
  • 37