Sha*_*hin 5 documentation fortran comments doxygen
是否可以在doxygen评论块中包含doxygen会忽略的内容?顺便说一句,我们可以在doxygen注释块中发表评论吗?
背景:
我们将Fortran项目的代码内注释转换为doxygen-parseable格式,但是项目要求代码内注释中的内容由水平线描述.例如:
!> @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
Run Code Online (Sandbox Code Playgroud)
是否有命令/语法我可以在这些行的前面加上,以便doxygen会忽略它们?希望是一个不引人注目且不影响评论可读性的文章.
我知道INPUT_FILTER可以用来在预处理脚本中链接的设置,但理想的解决方案是不依赖于其他脚本/工具的解决方案.
PS我很清楚很多人会认为这些水平线不必要和/或分散注意力.但是,这是由付款人颁布的要求,并不是我可以自由改变的.
Doxygen支持一些HTML命令,包括HTML注释.该解决方案的好处是不需要对Doxyfile进行任何修改,并且可以稍微分散注意力@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
Run Code Online (Sandbox Code Playgroud)
为了记录,这是我最终解决的解决方案.但是,我接受了DRH的答案,因为它为"在doxygen块中启用注释"提供了更通用的解决方案.
您可以利用 Doxygen 的别名语法来忽略该行,但是它需要该行以附加字符为前缀和后缀。例如,如果您定义了如下别名:
ALIASES = I{1}=""
Run Code Online (Sandbox Code Playgroud)
您可以在注释中使用别名来隐藏 doxygen 中的水平分隔符:
!> @brief Lorem ipsum dolor sit amet
!! @I{-----------------------------------------------------------------}
!!
!! @param[in] p1 Description of p1
!! @param[in] p2 Description of p2
!! @I{-----------------------------------------------------------------}
!!
!! More content here ....
!! @I{-----------------------------------------------------------------}
!!
!! More content for another section
!! @I{-----------------------------------------------------------------}
subroutine do_something(p1, p2)
! .... the code ...
end subroutine do_something
Run Code Online (Sandbox Code Playgroud)