Directives reference#
All directives use the f: domain prefix.
Entity directives#
All entity directives accept the following common options:
:module:set the parent module context
:permission:public,private, orprotected:noindex:suppress index entry generation
:noindexentry:suppress the directive from the general index
Directive |
Fortran entity |
Additional options |
|---|---|---|
|
Module |
(common options only) |
|
Submodule |
(common options only) |
|
Program |
(common options only) |
|
Function |
(common options only) |
|
Subroutine |
(common options only) |
|
Derived type |
|
|
Variable |
|
|
Type component (data member) |
(common options only) |
|
Interface |
|
|
Enum |
(common options only) |
|
Bound procedure |
|
|
Block data |
(common options only) |
|
Common block |
(common options only) |
|
Namelist |
(common options only) |
Usage examples#
Module with a function
.. f:module:: math_utils
.. f:function:: pure add(a, b)
Rendered output:
Type with members
.. f:currentmodule:: ref__directives
.. f:type:: point_t
.. f:member:: x
.. f:member:: y
Rendered output:
Generic interface
.. f:interface:: operator(+)
:generic:
Rendered output:
- interface operator(+)#
Interface heading
operator(+)appears and is marked generic.
Parameter constant
.. f:variable:: PI
:parameter:
Rendered output:
- parameter PI#
Context directives#
f:currentmoduleSet the current module context without producing output. Use
Noneto clear the context.Example
.. f:currentmodule:: my_module
FORD bridge directives#
f:automoduleAuto-document a single module from FORD sources. Requires
ford_project_fileorford_project_files.Options:
:visibility:filter entities by permission level. Comma-separated list, e.g.
publicorpublic,protected. Overridesford_display.:case:normalize Fortran keyword case for this directive.
lowerorupper. Overridesford_case.
Example:
.. f:automodule:: stdlib_ascii .. f:automodule:: dbcsr_api :case: upper .. f:automodule:: internal_mod :visibility: public,protected
f:autoprojectAuto-document all modules from a FORD project. Requires
ford_project_fileorford_project_files.Options:
:visibility:filter entities by permission level (same as
f:automodule).:case:normalize Fortran keyword case (same as
f:automodule).
Example:
.. f:autoproject:: :visibility: public
Doc fields (procedures)#
Inside f:function and f:subroutine:
:param name:(aliases::p:,:argument:,:arg:)argument description
:ftype name:argument Fortran type
:intent name:in,out, orinout:optional name:mark argument as optional
:returns:(alias:
:return:) return value description:rtype:return type