Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h2>On auto-generating C++ documentation:</h2> <p>After reading up on <a href="http://sphinx.pocoo.org/tutorial.html" rel="noreferrer">how to use sphinx</a> at all, you should have a look into <a href="http://michaeljones.github.com/breathe/index.html" rel="noreferrer">breathe</a>:</p> <blockquote> <p>Breathe provides a bridge between the Sphinx and Doxygen documentation systems.</p> <p>It is an easy way to include Doxygen information in a set of documentation generated by Sphinx. The aim is to produce an autodoc like support for people who enjoy using Sphinx but work with languages other than Python. The system relies on the Doxygen’s xml output.</p> </blockquote> <p>So additionally, you'll need to follow <a href="https://www.stack.nl/~dimitri/doxygen/" rel="noreferrer">Doxygen</a> commenting style and even setup an doxygen project. But I tried that and it works really well after the initial setup took place. Here is an excerpt of <a href="https://github.com/pyuniverse/pyuniverse/blob/cpp-cleanup/CMakeLists.txt" rel="noreferrer">our <code>CMakeLists.txt</code></a> which might give you an idea on how sphinx and doxygen work together:</p> <pre class="lang-none prettyprint-override"><code>macro(add_sphinx_target TARGET_NAME BUILDER COMMENT_STR) add_custom_target(${TARGET_NAME} COMMAND sphinx-build -b ${BUILDER} . sphinx/build/${BUILDER} WORKING_DIRECTORY docs DEPENDS doxygen COMMENT ${COMMENT_STR} ) endmacro(add_sphinx_target) add_custom_target(doxygen COMMAND doxygen docs/doxygen.conf COMMENT "Build doxygen xml files used by sphinx/breathe." ) add_sphinx_target(docs-html html "Build html documentation" ) </code></pre> <p>So after initial setup, essentially it boils down to:</p> <ol> <li>build doxygen documentation with <code>doxygen path/to/config</code></li> <li><code>cd</code> into the directory where the sphinx configuration is.</li> <li>build sphinx documentation with <code>sphinx-build . path/to/output</code></li> </ol> <h2>On the c++ domain:</h2> <p>Sphinx is a „little bit“ more than a system to auto-generate documentation. I would suggest you have a look <a href="http://sphinx.pocoo.org/examples.html" rel="noreferrer">at the examples</a> (and consider that the sphinx website itself is written in sphinx reST code). Especially click the <code>Show Source</code> link on many sphinx-generated pages.</p> <p>So if you cannot generate documentation automatically for a project, you have to do it yourself. Basically sphinx is a reST to whatever (LaTeX, HTML, …) compiler. So you can write arbitary text, but the advantage is that it has a lot of commands for documenting sourcecode of different languages. Each language gets its own domain (prefix or namespace) to separate the namespaces of the different languages. So for example I can document a python function using:</p> <pre class="lang-none prettyprint-override"><code>.. py:function:: Timer.repeat([repeat=3[, number=1000000]]) Does something nasty with timers in repetition </code></pre> <p>(<a href="http://sphinx.pocoo.org/domains.html#the-python-domain" rel="noreferrer">source</a>)</p> <p>I can do the same using the cpp domain:</p> <pre class="lang-none prettyprint-override"><code>.. cpp:function:: bool namespaced::theclass::method(int arg1, std::string arg2) Describes a method with parameters and types. </code></pre> <p>(<a href="http://sphinx.pocoo.org/domains.html#id1" rel="noreferrer">source</a>)</p> <p>So if you want to document your c++ project without doxygen+breathe but with sphinx, you'll have to write the restructured text files yourself. This also means that you split the documentation from your sourcecode, which can be undesirable.</p> <p>I hope that clears things up a bit. For further reading I <em>strongly</em> suggest that you have a good read on the <a href="http://sphinx.pocoo.org/tutorial.html" rel="noreferrer">sphinx tutorial</a> and <a href="http://sphinx.pocoo.org/contents.html" rel="noreferrer">documentation</a> until you understood what it actually does.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload