Doxygen:如何 link 到 Doxygen 生成的 HTML 文件的用户定义锚点?
Doxygen: how to link to an user-defined anchor of a Doxygen-generated HTML file?
我正在使用 Doxygen 1.8.17 和 CMake 3.14+ 来记录旧版 Fortran 77 应用程序。
我无法使用 Doxygen 解决以下用例:
One subroutine, located in a file named myenum.f90
, defines some values for Doxygen documentation and an @anchor command is set.
!> @brief get myenum
subroutine get(myenum)
!> @param[out] myenum
integer myenum
!> @anchor enum_myenum myenum's meaning
!! value | meaning
!! :-----:|:-------:
!! 1 |left
!! 2 |center
!! 3 |right
!> Compute myenum (code skipped)
myenum = 1
end subroutine
The other subroutine, located in a file named dosomething.f90
, uses these values and references the anchor to avoid documentation duplication.
!> do something based on myenum
subroutine dosomething(myenum, mystuff)
integer myenum !< @param[in] myenum [based on myenum enumerate](@ref enum_myenum)
character*(*) mystuff !< @param[out] my stuff
if (myenum.eq.1) then
mystuff='left'
elseif (myenum.eq.2) then
mystuff='center'
elseif (myenum.eq.3) then
mystuff='right'
endif
end subroutine
在 Doxygen 生成的文件 dosomething<...>.html
中创建了一个 hyperlink。 link 的目标不是 Doxygen 生成的文件 myenum<...>.html
而是 Fortran 文件 myenum.f90
.
有没有办法在锚点位置将 link 的目标设置为 myenum<...>.html
?
Doxygen 有很多创建链接的方法,使用 @ref
命令,使用 markdown 语法,一些自动链接等。也可以使用 \link ...\endlink
结构。
从您的示例(和我的测试)来看,@ref
和降价语法在这种情况下似乎不起作用。
我也尝试使用 \link..
命令,这(据我所知)有效,我的,有点扩展,示例:
!> do something based on myenum subroutine dosomething(myenum, mystuff, mythird)
integer myenum !< @param[in] [based on markdown syntax with @@ref](@ref enum_myenum)
character*(*) mystuff !< @param[out] @ref enum_myenum Based on @@ref command
double precision mythird !< @param[out] @link enum_myenum based on @@link command \endlink
if (myenum.eq.1) then
mystuff='left'
elseif (myenum.eq.2) then
mystuff='center'
elseif (myenum.eq.3) then
mystuff='right'
endif
end subroutine
还有当前的doxygen版本1.8.18和当前的master(1.8.19 (cd581388f3d013c501e3cefbaf3e81cf93d46fcb))问题仍然存在。
绝对值得在 doxygen 问题跟踪器中提交问题/错误报告:https://github.com/doxygen/doxygen/issues/new
我正在使用 Doxygen 1.8.17 和 CMake 3.14+ 来记录旧版 Fortran 77 应用程序。
我无法使用 Doxygen 解决以下用例:
One subroutine, located in a file named
myenum.f90
, defines some values for Doxygen documentation and an @anchor command is set.
!> @brief get myenum
subroutine get(myenum)
!> @param[out] myenum
integer myenum
!> @anchor enum_myenum myenum's meaning
!! value | meaning
!! :-----:|:-------:
!! 1 |left
!! 2 |center
!! 3 |right
!> Compute myenum (code skipped)
myenum = 1
end subroutine
The other subroutine, located in a file named
dosomething.f90
, uses these values and references the anchor to avoid documentation duplication.
!> do something based on myenum
subroutine dosomething(myenum, mystuff)
integer myenum !< @param[in] myenum [based on myenum enumerate](@ref enum_myenum)
character*(*) mystuff !< @param[out] my stuff
if (myenum.eq.1) then
mystuff='left'
elseif (myenum.eq.2) then
mystuff='center'
elseif (myenum.eq.3) then
mystuff='right'
endif
end subroutine
在 Doxygen 生成的文件 dosomething<...>.html
中创建了一个 hyperlink。 link 的目标不是 Doxygen 生成的文件 myenum<...>.html
而是 Fortran 文件 myenum.f90
.
有没有办法在锚点位置将 link 的目标设置为 myenum<...>.html
?
Doxygen 有很多创建链接的方法,使用 @ref
命令,使用 markdown 语法,一些自动链接等。也可以使用 \link ...\endlink
结构。
从您的示例(和我的测试)来看,@ref
和降价语法在这种情况下似乎不起作用。
我也尝试使用 \link..
命令,这(据我所知)有效,我的,有点扩展,示例:
!> do something based on myenum subroutine dosomething(myenum, mystuff, mythird)
integer myenum !< @param[in] [based on markdown syntax with @@ref](@ref enum_myenum)
character*(*) mystuff !< @param[out] @ref enum_myenum Based on @@ref command
double precision mythird !< @param[out] @link enum_myenum based on @@link command \endlink
if (myenum.eq.1) then
mystuff='left'
elseif (myenum.eq.2) then
mystuff='center'
elseif (myenum.eq.3) then
mystuff='right'
endif
end subroutine
还有当前的doxygen版本1.8.18和当前的master(1.8.19 (cd581388f3d013c501e3cefbaf3e81cf93d46fcb))问题仍然存在。
绝对值得在 doxygen 问题跟踪器中提交问题/错误报告:https://github.com/doxygen/doxygen/issues/new