I'm trying to figure out if there's a way to nest Sphinx extension directives. I have a few custom node types that are working great, but I'd like a little more flexibility in the HTML I'm generating.
Here's an example of what I'm trying to accomplish:
Say I have a directive that creates a textbox and button that triggers some JavaScript. This works fine - I can put this in my reST file:
.. myDirective:: name
:opt1: val
content
Now, I want the ability to create a tabbed interface with jQuery in the output. I have a node type that creates the raw HTML/JavaScript needed for this to happen.
What I would like to be able to do is give the tab node 1 or more instances of myDirective (or other directives), and have it put each instance into another tab. Something like this:
..tabbedInterface::
.. myDirective:: name1
:op1: val1
content
.. myDirective:: name2
:op1: val1
content
Obviously this is a pretty specific case, but this is generally what I'd like to accomplish - nested directives.
toctree:: :maxdepth: 2 intro strings datatypes numeric (many more documents listed here) This accomplishes two things: Tables of contents from all those documents are inserted, with a maximum depth of two, that means one nested heading. toctree directives in those documents are also taken into account.
Literal code blocks (ref) are introduced by ending a paragraph with the special marker :: . The literal block must be indented (and, like all paragraphs, separated from the surrounding ones by blank lines): This is a normal text paragraph.
The configuration-block extension might help you : https://github.com/fabpot/sphinx-php/blob/master/sensio/sphinx/configurationblock.py
From : http://symfony.com/doc/2.0/contributing/documentation/format.html#configuration-blocks
.. configuration-block::
.. code-block:: yaml
# Configuration in YAML
.. code-block:: xml
<!-- Configuration in XML //-->
.. code-block:: php
// Configuration in PHP
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With