How to comment out comment in Doxygen documentation

你离开我真会死。 提交于 2019-12-06 07:18:30

问题


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?


回答1:


Did you try \cond \endcond tags? It's described here http://www.doxygen.nl/manual/commands.html#cmdcond http://www.doxygen.nl/manual/commands.html#cmdendcond




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/14337003/how-to-comment-out-comment-in-doxygen-documentation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!