ford
ford copied to clipboard
Namelist docs generation
For GS2, we monkeypatch FORD to extract documentation for namelists. We do this based on very project specific type, but I could imagine adding something to FORD to do this more generally.
Perhaps a syntax like:
![namelist: name_of_namelist
integer :: input_variable !< docstring
real :: another_input !< more docs
!]
which would extract everything between ![namelist and !] into a namelist page, similar to the modules/procedures/types pages.
Is there any interest in a feature like this?
I can see the benefit of documenting namelists. However, I think it might be better to place the doc-comments around the actual namelist declaration. Internally FORD could then pull in all of the documentation for the component variables of the namelist (similar to how it does this type-bound procedures when producing documentation for derived types).
Good point, then it might not even need the doc-comments, except if you want a docstring on the namelist itself:
integer :: foo !< docstring
real :: bar !< more docs
!> This namelist controls the thing-a-ma-jig
namelist /thing_a_ma_job/ foo, bar