Skip to main content

includes jinja templates in a documentation

Project description

sphinx-jinja
============

A sphinx extension to include jinja based templates based documentation into a sphinx doc

Usage
=====

In your rst doc, you can use the following snippet to use a jinja template to generate your doc

.. code:: rst

.. jinja:: first_ctx

{% for k, v in topics.items() %}

{{k}}
~~~~~
{{v}}
{% endfor %}

In your sphinx ``conf.py`` file, you can create or load the contexts needed for your jinja templates

::
extensions = ['sphinxcontrib.jinja']

jinja_contexts = {
'first_ctx': {'topics': {'a': 'b', 'c': 'd'}}
}


Each element of the `jinja_contexts` dictionary is a context dict for use in your jinja templates

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sphinx-jinja, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size sphinx_jinja-0.1.1-py2-none-any.whl (3.9 kB) File type Wheel Python version 2.7 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page