Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignoring lines within a doxygen comment block

Is it possible to include content within a doxygen comment block that will be ignored by doxygen? In order words, can we have comments within a doxygen comment block?

Background:

We're converting the in-code comments for a Fortran project to a doxygen-parseable format, however the project requires that the content within the in-code comments be delineated by horizontal lines. For example:

!> @brief Lorem ipsum dolor sit amet
!! ---------------------------------------------------------------------
!!
!! @param[in] p1  Description of p1
!! @param[in] p2  Description of p2
!! ---------------------------------------------------------------------
!!
!! More content here ....
!! ---------------------------------------------------------------------
!!
!! More content for another section
!! ---------------------------------------------------------------------
subroutine do_something(p1, p2)
  ! .... the code ...
end subroutine do_something

Is there a command/syntax I can prefix those lines with so that doxygen will ignore them? Hopefully, one that is unobtrusive and does not affect the readability of the comments.

I am aware of the INPUT_FILTER settings which one can use to chain in a preprocessing script, but the ideal solution would be one that does not depend on additional scripts/tools.

P.S. I'm well aware that many would think those horizontal lines unnecessary and/or distracting. However, it is a requirement decreed by the paymaster and is not something that I am at the liberty to change.

like image 217
Shawn Chin Avatar asked Sep 07 '12 14:09

Shawn Chin


People also ask

How do you comment with doxygen?

doxygen Getting started with doxygen Commenting your code//! //! ... text ... //! Note the 2 slashes to end the normal comment block and start a special comment block. To structure and fomat the generated documentation, Doxygen provides a large number (> 170) of special commands.

What is doxygen used for?

This medication is used to treat a wide variety of bacterial infections, including those that cause acne. This medication is also used to prevent malaria. This medication is known as a tetracycline antibiotic. It works by stopping the growth of bacteria.


1 Answers

Doxygen supports some HTML commands including HTML comments. This solution has the benefit of not requiring any modifications to the Doxyfile and marginally less distracting than @I{ ---- }.

!> @brief Lorem ipsum dolor sit amet
!! <!----------------------------------------------------------------->
!!
!! @param[in] p1  Description of p1
!! @param[in] p2  Description of p2
!! <!----------------------------------------------------------------->
!!
!! More content here ....
!! <!----------------------------------------------------------------->
!!
!! More content for another section
!! <!----------------------------------------------------------------->
subroutine do_something(p1, p2)
  ! .... the code ...
end subroutine do_something

For the record, this is the solution which I eventually settled on. However, I've accepted DRH's answer as it provides a more generic solution to "enabling comments within a doxygen block".

like image 160
Shawn Chin Avatar answered Oct 15 '22 02:10

Shawn Chin