3
votes

I am using Doxygen's \page, \subpage and \section constructions to make overview documentation for my application. Somewhere in this I am using HTML to create a nicely formatted table.

However, I want to remove a part of the table in the output, without removing the comment itself. E.g.

/*!
\page MAINPAGE Main Page

<table>
   <tr>
      <td>Do This</td>
      <td>100</td>
   </tr>
   <tr>
      <td>Do That</td>
      <td>200</td>
   </tr>
   <tr>
      <td>Yet another one</td>
      <td>300</td>
   </tr>
</table>

I want to remove the line containing 'Do That' without removing the 'text' itself from the file.

If this were simple source code, I could simply comment this out using // or /* */.

I found out that I could use \if or \latexonly (we only generate html output) but both seem a workaround (looks like using if(false) in code to comment out a block).

Isn't there a clean way to comment out comment in Doxygen?

3

3 Answers

2
votes

Enclose the part to be excluded within @cond and @endcond blocks. Like so:

@cond DOXYGEN_EXCLUDE
<tr>
    <td>Do That</td>
    <td>200</td>
</tr>
@endcond

and ensure that you have not defined DOXYGEN_EXCLUDE in any place that doxygen can see. DOXYGEN_EXCLUDE is just what I use, it not a special keyword, you can choose any name you prefer.

1
votes

Besides \cond...\endcond you can also use HTML comments, i.e <!-- this is a comment in a comment --> inside doxygen comments, as explained at the bottom of this page in the manual http://www.doxygen.org/manual/htmlcmds.html