So, I just came in need of something like this...will somebody be so kind as to post some Fortran source files that include documentation in reStructuredText....in fact, I am still in doubt on how exactly sphinx and this extension can be used...
--
You received this message because you are subscribed to a topic in the Google Groups "sphinx-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sphinx-users/gQfMxDsXQo0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sphinx-users...@googlegroups.com.
To post to this group, send email to sphinx...@googlegroups.com.
Visit this group at http://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.
Hello, I am also trying to generate auto documents by Sphinx on fortran codes. I could add fortran extensions to Sphinx and successfully run $ make html. But the output is only the program name in document.
├── doc
│ ├── _build
│ ├── conf.py
│ ├── index.rst
│ ├── make.bat
│ ├── Makefile
│ ├── _static
│ └── _templates
└── project
└── caf10.f
sys.path.insert(0, os.path.abspath("../project/caf10.f"))
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'vacumm.sphinxext.fortran_domain',
'vacumm.sphinxext.fortran_autodoc'
]
fortran_src = [
'/home/Documents/fortran-sphinx/project/caf10.f'
]
index.rst contains:
Documentation for the Code
**************************
.. f:autoprogram:: caf10
Contents:
.. toctree::
:maxdepth: 2
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Fortran program is something like:
C Handling system components
PROGRAM caf10
IMPLICIT NONE
INTEGER NOERR, NSCOM, I
CHARACTER FNAME*12, SCNAME*24
C Initialise program
CALL TQINI(NOERR)
FNAME = 'cosi.dat'
C Open cosi.dat (system C-O-Si)
C for reading
CALL TQOPNA(FNAME, 10, NOERR)
C Read data-file
CALL TQRFIL(NOERR)
C Close data-file
CALL TQCLOS(10, NOERR)
C Print the names of all system components
WRITE(*,FMT='(A)') 'Names of system components:'
DO I=1, NSCOM
CALL TQGNSC(I, SCNAME, NOERR)
WRITE(*,FMT='(I2,A)') I, ': ' // SCNAME
ENDDO
END
I don't have module or function definition in these fortran programs. I want to highlight the codes and comments, use cross references, and print the output of each method into the documentation.
The output of generated document is just the program name, and nothing else is included in the documentation:
program caf10
By running make html
, it logs no error:
$ make html
sphinx-build -b html -d _build/doctrees . _build/html
Running Sphinx v1.2.3
loading pickled environment... not yet created
loading intersphinx inventory from http://docs.python.org/objects.inv...
parsing fortran sources... done
building [html]: targets for 1 source files that are out of date
updating environment: 1 added, 0 changed, 0 removed
test1ng sources... [100%] index
/home/masood/Documents/fortran-sphinx-2/doc/index.rst:4: WARNING: test2
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
writing additional files... genindex search
copying static files... done
copying extra files... done
dumping search index... done
dumping object inventory... done
build succeeded, 1 warning.
Do you have any idea how can I make a document which parsed the program, highlighted commands, included comments, and added cross references?