I wanted to document a Fortran module containing functions with doxygen.
My problem is, that I can't find a way to include the body of my functions in the documentation of the functions. There is only a link to the position, but not the actual source code.
At the moment, my source code looks e.g. like this:
!> @brief Get a starting time.
!> @details Get an object with time information.
!> @return returns the time with high precision
FUNCTION get_start_time() RESULT(stime)
TYPE (time) :: stime
CALL SYSTEM_CLOCK(stime%count, stime%rate, stime%max)
END FUNCTION
My doxygen configuration (the SOURCES part) looks like this:
SOURCE_BROWSER = YES
INLINE_SOURCES = YES
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
REFERENCES_LINK_SOURCE = YES
SOURCE_TOOLTIPS = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
I also tried to use the @code and @endcode flags to mark the source, but this doesn't work, too.
What should I do, to get the source code directly to the documentation?
1st EDIT: I tried @cheeseminer's solution. So the code above now looks like
!> @brief Get a starting time.
!> @details Get an object with time information.
!> @return returns the time with high precision
!> @par Code
!> @snippet folder/file.F90 get_start_time
!! [get_start_time]
FUNCTION get_start_time() RESULT(stime)
TYPE (time) :: stime
CALL SYSTEM_CLOCK(stime%count, stime%rate, stime%max)
END FUNCTION
!! [get_start_time]
Unfortunately, the block-id commands (those with !! in front) appear in the documentation and/or the full source code. What is the correct way, to do this in Fortran?
Or is there a better way to solve my initial question?
2nd EDIT: I found a workaround which hides the block-id. I wrapped them in an @internal command.
!> @internal [get_start_time]
3rd EDIT: I'm now using @Michael's suggestion to include the block-id as HTML-Comment.
!> <!-- [get_start_time] -->
4th EDIT: I posted a follow-up question concerning aliases.
!>for the snippet marker lines - at least, for the second one. It does not seem to make sense to need the@internal.@internaland using!>to get!> [get_start_time], I get the text "[get_start_time]" in the documentation (twice), which is not favourable. The@internalhides these occurrences.!>... just use a normal comment, doxygen will still find itSTRIP_CODE_COMMENTS.