Using breathe for automatic documentation

I just looked into the breathe project, which acts as a bridge between doxygen and sphinx. Seems like a useful alternative to FORD to me, since I’m writing most of my user documentation in sphinx anyway. For C based projects this seems to work, so at least for documenting a C-API of a Fortran project this might be an option. Now that doxygen has also support for Fortran, it could allow for having all code documentation in one place rendered consistently with sphinx.

Has anyone tried this for Fortran projects and can report success? My initial attempt wasn’t too successful, but I might have missed some setup on the doxygen side of things.

4 Likes

I opened an issue upstream to ask for Fortran support:

The breathe project is currently looking for volunteers and/or funding to add new features.

I’ve use doxygen for a while but stopped using it when I started to use submodules because doxygen does/did not support them.

2 Likes

I deployed the first part of breathe generated documentation at C API — tblite documentation, which did work quite nicely (for the C API) and the result also looks pretty. It needs a lot more examples to become useful, but at least all declarations are available on the readthedocs pages.

Hi @awvwgk I just so your project and was wondering if you managed to evolve the documentation using breathe?

I currently use heavily sphinx for a python API and just love the rendering and flexibility. I’m also using FORD for the backend documentation but would love to have a single style at the end (preferably sphinx) just as you said in your first post.

I have yet to try out the doxygen->breathe->sphinx strategy but wanted to ask about your experience before?

I once tried the sphynx-fortran extension but quit basically immediately because using numpy.f2py meant the code had to be complaint with f2py which is not easy once one has complex derived types, and is not longer maintained it seems… using FORD with “preprocess False” enabled to generate the doc irrespective of the source code, but still missing so many of the possibilities with sphinx…