a simply python program for f90
module file auto documentation. The auto-generated documentation is Emacs org-mode
file.
By using some simple tool, such as pandoc
, it can be converted to many other formats.
- Step 1: generate the
org
file. For example,example.f90
insrc
,
python example.f90 -o example.org
- Step 2: use
pandoc
to get the target documentation. For example,html
pandoc example.org -o example.html
The workflow for f2og
is
- Determine the start and end of each code block
- Depending on the type of the code block extract the
header
andbody
information and export toorg
file.
For a line starting with !>
, the text after !>
will be extracted to the org
file.
When you wish to start a new paragraph, inset \\\
at the end of the last line.
The documentation for the code block (module, function, and subroutine) should come before the code block. It should be noted that, only lines startin with !>
will become a part of the documentation, while lines starting with !
will not.
By inserting the !!>>
above the starting of the variable list and !!<<
below the end of the variable list (Here the variable list is the variable that you would like to show in the documentation, exclude the variables in the function/subroutine interface).
To export some comments or source code, one option is to add !->>
and !-<<
to export the
Some org-mode
headers, such as title, author, comes with !=OH
In order to make f2org
work properly, the Fortran
code should satisfy the following requirement:
-
In the current version, only file with one
module
in a file is supported. If you have aprogram file
, a file with multiplemodules
or a file withoutmodule
,f2org
will not work -
The Documentation for the code block should be placed before the begining of the block.
-
For each clode block,
Implicit None
is essentlal. -
For
subroutine
, Theintent
statement for the IO variables is essential. -
For
function
, only the programming wayfunction foo(a,b) output(c)
will be
detect correctly.
- To export correctly, always add
::
while declear the variables.
See docs
- add comments to code
- write manual
- Support for more file types