sphinxfortran.fortran_domain
– Fortran domain¶
A fortran domain for sphinx
-
class
sphinxfortran.fortran_domain.
FortranCallField
(name, names=(), label=None, rolename=None)[source]¶ Bases:
sphinxfortran.fortran_domain.FortranField
-
is_grouped
= True¶
-
-
class
sphinxfortran.fortran_domain.
FortranCompleteField
(name, names=(), typenames=(), label=None, rolename=None, typerolename=None, shapenames=None, attrnames=None, prefix=None, strong=True, can_collapse=False)[source]¶ Bases:
sphinxfortran.fortran_domain.FortranField
,sphinx.util.docfields.GroupedField
A doc field that is grouped and has type information for the arguments. It always has an argument. The argument can be linked using the given rolename, the type using the given typerolename.
Two uses are possible: either parameter and type description are given separately, using a field from names and one from typenames, respectively, or both are given using a field from names, see the example.
Example:
:param foo: description of parameter foo :type foo: SomeClass -- or -- :param SomeClass foo: description of parameter foo
-
is_typed
= 2¶
-
-
class
sphinxfortran.fortran_domain.
FortranCurrentModule
(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]¶ Bases:
docutils.parsers.rst.Directive
This directive is just to tell Sphinx that we’re documenting stuff in module foo, but links to module foo won’t lead here.
-
final_argument_whitespace
= False¶
-
has_content
= False¶
-
option_spec
= {}¶
-
optional_arguments
= 1¶
-
required_arguments
= 0¶
-
-
class
sphinxfortran.fortran_domain.
FortranDocFieldTransformer
(directive, modname=None, typename=None)[source]¶ Bases:
sphinx.util.docfields.DocFieldTransformer
Transforms field lists in “doc field” syntax into better-looking equivalents, using the field type definitions given on a domain.
-
class
sphinxfortran.fortran_domain.
FortranDomain
(env)[source]¶ Bases:
sphinx.domains.Domain
Fortran language domain.
-
directives
= {'function': <class 'sphinxfortran.fortran_domain.FortranWithSig'>, 'currentmodule': <class 'sphinxfortran.fortran_domain.FortranCurrentModule'>, 'subroutine': <class 'sphinxfortran.fortran_domain.FortranWithSig'>, 'autoroutine': <class 'sphinxfortran.fortran_autodoc.FortranAutoObjectDirective'>, 'autosrcfile': <class 'sphinxfortran.fortran_autodoc.FortranAutoSrcfileDirective'>, 'module': <class 'sphinxfortran.fortran_domain.FortranModule'>, 'autofunction': <class 'sphinxfortran.fortran_autodoc.FortranAutoFunctionDirective'>, 'program': <class 'sphinxfortran.fortran_domain.FortranProgram'>, 'autoprogram': <class 'sphinxfortran.fortran_autodoc.FortranAutoProgramDirective'>, 'variable': <class 'sphinxfortran.fortran_domain.FortranObject'>, 'automodule': <class 'sphinxfortran.fortran_autodoc.FortranAutoModuleDirective'>, 'type': <class 'sphinxfortran.fortran_domain.FortranType'>, 'autosubroutine': <class 'sphinxfortran.fortran_autodoc.FortranAutoSubroutineDirective'>}¶
-
find_obj
(env, modname, name, role, searchorder=0)[source]¶ Find a Fortran object for “name”, perhaps using the given module and/or typename.
Params: - searchorder, optional: Start using relative search
-
indices
= [<class 'sphinxfortran.fortran_domain.FortranModuleIndex'>]¶
-
initial_data
= {'objects': {}, 'modules': {}}¶
-
label
= 'Fortran'¶
-
name
= 'f'¶
-
object_types
= {'function': <sphinx.domains.ObjType object at 0x7f78825d19d0>, 'subroutine': <sphinx.domains.ObjType object at 0x7f78825d1a90>, 'module': <sphinx.domains.ObjType object at 0x7f78825d1b10>, 'program': <sphinx.domains.ObjType object at 0x7f78825d1790>, 'variable': <sphinx.domains.ObjType object at 0x7f78825d1910>, 'type': <sphinx.domains.ObjType object at 0x7f78825d1850>}¶
-
roles
= {'subr': <sphinxfortran.fortran_domain.FortranXRefRole object at 0x7f78825d1c90>, 'var': <sphinxfortran.fortran_domain.FortranXRefRole object at 0x7f78825d1c10>, 'func': <sphinxfortran.fortran_domain.FortranXRefRole object at 0x7f78825d1c50>, 'prog': <sphinxfortran.fortran_domain.FortranXRefRole object at 0x7f78825d1b90>, 'type': <sphinxfortran.fortran_domain.FortranXRefRole object at 0x7f78825d1bd0>, 'mod': <sphinxfortran.fortran_domain.FortranXRefRole object at 0x7f78825d1cd0>}¶
-
-
class
sphinxfortran.fortran_domain.
FortranField
(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]¶ Bases:
docutils.parsers.rst.Directive
Directive to describe a change/addition/deprecation in a specific version.
-
final_argument_whitespace
= True¶
-
has_content
= True¶
-
option_spec
= {'shape': <function parse_shape at 0x7f78825d0410>, 'type': <function unchanged at 0x7f78857d45f0>, 'attrs': <function unchanged at 0x7f78857d45f0>}¶
-
optional_arguments
= 0¶
-
required_arguments
= 1¶
-
-
class
sphinxfortran.fortran_domain.
FortranModule
(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]¶ Bases:
docutils.parsers.rst.Directive
Directive to mark description of a new module.
-
final_argument_whitespace
= False¶
-
has_content
= False¶
-
option_spec
= {'noindex': <function flag at 0x7f78857d4500>, 'platform': <function <lambda> at 0x7f78825d61b8>, 'synopsis': <function <lambda> at 0x7f78825d6230>, 'deprecated': <function flag at 0x7f78857d4500>}¶
-
optional_arguments
= 0¶
-
required_arguments
= 1¶
-
-
class
sphinxfortran.fortran_domain.
FortranModuleIndex
(domain)[source]¶ Bases:
sphinx.domains.Index
Index subclass to provide the Fortran module index.
-
localname
= iu'Fortran Module Index'¶
-
name
= 'modindex'¶
-
shortname
= iu'fortran modules'¶
-
-
class
sphinxfortran.fortran_domain.
FortranObject
(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]¶ Bases:
sphinx.directives.ObjectDescription
Description of a general Fortran object.
-
_parens
= ''¶
-
doc_field_types
= [<sphinxfortran.fortran_domain.FortranCompleteField object at 0x7f78825d1150>, <sphinxfortran.fortran_domain.FortranCompleteField object at 0x7f78825d1190>, <sphinxfortran.fortran_domain.FortranCompleteField object at 0x7f78825d1210>, <sphinxfortran.fortran_domain.FortranCompleteField object at 0x7f78825d1310>, <sphinxfortran.fortran_domain.FortranCallField object at 0x7f78825d1390>, <sphinxfortran.fortran_domain.FortranCallField object at 0x7f78825d1410>]¶
-
get_signature_prefix
(sig)[source]¶ May return a prefix to put before the object name in the signature.
-
handle_signature
(sig, signode)[source]¶ Transform a Fortran signature into RST nodes. Returns (fully qualified name of the thing, classname if any).
If inside a class, the current class name is handled intelligently: * it is stripped from the displayed name if present * it is added to the full name (return value) if not present
-
needs_arglist
()[source]¶ May return true if an empty argument list is to be generated even if the document contains none.
-
option_spec
= {'noindex': <function flag at 0x7f78857d4500>, 'shape': <function parse_shape at 0x7f78825d0410>, 'type': <function unchanged at 0x7f78857d45f0>, 'attrs': <function unchanged at 0x7f78857d45f0>, 'module': <function unchanged at 0x7f78857d45f0>}¶
-
stopwords
= set(['integer', 'float', 'character', 'long', 'double'])¶
-
-
class
sphinxfortran.fortran_domain.
FortranProgram
(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]¶ Bases:
sphinxfortran.fortran_domain.FortranSpecial
,sphinxfortran.fortran_domain.WithFortranDocFieldTransformer
,sphinxfortran.fortran_domain.FortranObject
-
class
sphinxfortran.fortran_domain.
FortranType
(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]¶ Bases:
sphinxfortran.fortran_domain.FortranSpecial
,sphinxfortran.fortran_domain.WithFortranDocFieldTransformer
,sphinxfortran.fortran_domain.FortranObject
-
class
sphinxfortran.fortran_domain.
FortranTypeField
(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]¶
-
class
sphinxfortran.fortran_domain.
FortranWithSig
(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]¶ Bases:
sphinxfortran.fortran_domain.FortranSpecial
,sphinxfortran.fortran_domain.WithFortranDocFieldTransformer
,sphinxfortran.fortran_domain.FortranObject
Description of a function of subroutine
-
_parens
= '()'¶
-
-
class
sphinxfortran.fortran_domain.
FortranXRefRole
(fix_parens=False, lowercase=False, nodeclass=None, innernodeclass=None, warn_dangling=False)[source]¶ Bases:
sphinx.roles.XRefRole
-
class
sphinxfortran.fortran_domain.
WithFortranDocFieldTransformer
[source]¶ -
run
()[source]¶ Same as
sphinx.directives.ObjectDescription()
but usingFortranDocFieldTransformer
-
-
sphinxfortran.fortran_domain.
_pseudo_parse_arglist
(signode, arglist)[source]¶ “Parse” a list of arguments separated by commas.
Arguments can have “optional” annotations given by enclosing them in brackets. Currently, this will split at any comma, even if it’s inside a string literal (e.g. default argument value).
-
sphinxfortran.fortran_domain.
add_shape
(node, shape, modname=None, nodefmt=<class 'docutils.nodes.Text'>)[source]¶ Format a shape expression for a node
-
sphinxfortran.fortran_domain.
convert_arithm
(node, expr, modname=None, nodefmt=<class 'docutils.nodes.Text'>)[source]¶ Format an arithmetic expression for a node
-
sphinxfortran.fortran_domain.
re_fieldname_match
()¶ match(string[, pos[, endpos]]) –> match object or None. Matches zero or more characters at the beginning of the string