Sphinx is a new documentation tool for Python. It looks very nice. What I'm wondering is:
- How suitable this is for documenting a C++ project?
- Are there any tools for converting existing documentation (e.g. doxygen) to Sphinx format?
- Are there online/downloadable examples of C++ projects that use Sphinx?
- Any tips from anyone who has used Sphinx?
First, keep two directory trees,
source
andbuild
. Putsource
under version control. Don't putbuild
under version control, rebuild it as part of installation.Second, read http://sphinx.pocoo.org/intro.html#setting-up-the-documentation-sources.
Use the
sphinx-quickstart
to build a practice documentation tree. Play with this for a few days to learn how it works. Then use it again to build the real thing in SVN directories.Organize your documentation in a well-planned tree. Some sections need an "index.rst" for that section, some don't. It depends on how "stand-alone" the section is.
Our top-level
index.rst
looks like this.Note, we don't "include" the API, we just reference it with an ordinary HTML link.
Sphinx has a very cool add-on, called automodule, which picks the docstrings out of Python modules.
Update As of Sphinx 1.0, C and C++ are supported. http://sphinx.pocoo.org/
Have a look at http://www.nabble.com/Using-doxygen-and-sphinx-together-td20989904.html for an XML approach.
As mentioned here and here,
[Edit inserted below]:
I tested the doxygen+breathe+sphinx toolchain on a multi-10k C++ library consisting of 10 different modules/domains. My bottom line is:
Let me elaborate these points:
I had problems with:
In a more general sense, be aware that it ATM is a bridge to Doxygen's xml output. That should not be understood in such a way that it will exactly output what doxygen does, just with the above limitations. Rather, it offers you exactly, not more, not less, the possibilities to
In my opinion, a fully functional breathe would fill a major gap and open up quite a cool road. So it is worth watching just because of the potential gain.
It sadly seems that maintainance through the creator will go down severely in the future. So if you are working in a company and can convince your boss that breathe would suit him, or have some free time and are looking for a really valuable project, consider to give it a fork!
As a final pointer, also note the doxylink contrib project for sphinx, which may provide an intermediate solution: build up a surrounding tutorial-like structure which references the (css-style matched) old doxygen documentation (i think you could even inject the same header into sphinx and on top of the doxygen documentation for look'n'feels). That way, your project keeps an affinity to sphinx, and when breathe is fully there, you are prepared to jump on. But again: consider showing breathe some love if it fits your agenda.