Example Block Extension For Sphinx
This is a modified fork of Serge Domkowski's examplecode extension for Sphinx.
About
This is a simple extension that, when rendered as HTML, will fold multiple example blocks containing different examples into a single block which can be toggled from one to another using buttons.
This extension adds the example-block
directive which adds a class to
a container wrapping the code blocks that should be folded. The class allows
the included JavaScript and CSS to render the folded block and buttons.
Quick Example
Source would look something like this:
.. example-block:: .. code-block:: python import api .. code-block:: ruby require 'my-api'
Installation
$ pip install sphinxcontrib-exampleblock
Enabling The eExtension In Sphinx
Add sphinxcontrib.exampleblock to the list of extensions in the conf.py file. For example:
extensions = ['sphinxcontrib.example']
Contribute
Support
If you are having issues, please let us know.
License
The project is licensed under MIT.