Comparison of GCC docs in Texinfo and Sphinx#

HTML output#

Formatting#

Sphinx provides left menu navigation and side bar navigation (for subsections) on a page. Moreover, it’s using a richer CSS formats including the code highlighting for code snippets, bash sessions or a JSON output.

Texinfo version:

_images/texinfo-html-gcov.png

Sphinx version (see Profiling and Test Coverage in Freestanding Environments):

_images/sphinx-html-gcov.png

Built-in Search Engine#

Sphinx provides built-in search enging for a fast navigation:

_images/sphinx-search.png

Cross-manual references#

Sphinx (using Intersphinx extension) provides an elagant way how to cross reference other manuals): (e.g. :ref:`gcc:amd-gcn-options` AMD GCN Options)

_images/sphinx-cross-refs.png

Function documentation#

Sphinx provides very rich directives when documenting a function, it’s arguments, return value, etc.

.. c:function:: PyObject *PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)

:param type: description of the first parameter.
:param nitems: description of the second parameter.
:returns: a result.
:retval NULL: under some conditions.
:retval NULL: under some other conditions as well.

which results in:

PyObject *PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)#
Parameters:
  • type – description of the first parameter.

  • nitems – description of the second parameter.

Returns:

a result.

Return values:
  • NULL – under some conditions.

  • NULL – under some other conditions as well.

PDF output#

Cross-manual references#

Again, PDF version contains many references which are handy with preview feature:

Texinfo version:

_images/texinfo-pdf-link.png

Sphinx version:

_images/sphinx-pdf-link.png

Code highlighting#

Again, the PDF version provides built-in syntax highlighting provided by Pygments package:

_images/sphinx-pdf-code.png