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.


I have used f:autoprogram directive in index.rst. Further details are in
the following:

My program tree is like this:

├── doc
│ ├── _build
│ ├── conf.py
│ ├── index.rst
│ ├── make.bat
│ ├── Makefile
│ ├── _static
│ └── _templates
└── project

 └── caf10.f



conf.py includes:

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`


We don't have module or function definition in these fortran programs. We 
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.
 

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to