Welcome to Stuff Counter’s documentation!¶
This project is a dummy extension meant to serve as an example for extensions writers. It illustrates the definition of a directive that:
is automatically numbered,
can be referenced (using
:ref:
or:numref:
).
If you want to write such a directive, study this extension source code. The main points to look at (and copy) are:
in the
setup()
function, the call toadd_enumerable_node()
;definition of the directive (class
StuffDirective
in this example).
Good luck!
Example¶
The next stuff does not have a caption.
This stuff does not have a caption (althouth Stuff 1 has one).
Source¶
The following code has produced the above example.
.. _this:
.. stuffcounter:stuff::
:caption: A stuff *with* a caption.
The :ref:`next stuff <that>` does not have a caption.
.. _that:
.. stuffcounter:stuff::
This stuff does not have a caption
(althouth :numref:`this` has one).
Features¶
Automatic numbering.
Directives are labelled the Sphinx way.
Directives can be referenced with
:ref:
::ref:`this`
produces A stuff with a caption;:ref:`That <that>`
produces That.
Directives can be referenced with
:numref:
:numref:`that`
produces Stuff 2;:numref:`Stuff {number} ({name}) <this>`
produces Stuff 1 (A stuff with a caption).
Documentation can be rendered in HTML and LaTeX.