Skip to main content
https://img.shields.io/travis/tardyp/sphinx-jinja.svg?maxAge=2592000

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

.. 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'}}
}

Available options

  • file: allow to specify a path to Jinja instead of writing it into the content of the directive. Path is relative to the current directory of sphinx-build tool, typically the directory where the conf.py file is located.

  • header_char: character to use for the the headers. You can use it in your template to set your

    own title character:

    For example:

    Title
    {{ options.header_char * 5 }}

Example of declaration in your RST file:

.. jinja:: approval_checks_api
   :file: relative/path/to/template.jinja
   :header_char: -

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

Running tests

  • pip install tox

  • tox

Metadata

Release files for sphinx-jinja 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-jinja 1.0.0
File Size Uploaded
sphinx-jinja-1.0.0.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-jinja 1.0.0
File Interpreter ABI Platform
sphinx_jinja-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / sphinx-jinja-1.0.0.tar.gz

Download URL sphinx-jinja-1.0.0.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
768061fe1f07f29517c7ebb212422852760c355640b290fd4460bffdcb4310d5
BLAKE2b-256 checksum
How to use checksums
17e843c58fb4e49afca3f8f4a5ac7ac0070c5a941949314466d9a56c729a54fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

Release files / sphinx_jinja-1.0.0-py3-none-any.whl

Download URL sphinx_jinja-1.0.0-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f90e754ceb12e5837cb7f7ade189b98e6bb18f308e8a6494eaff0f6589d20d87
BLAKE2b-256 checksum
How to use checksums
500d4773e81743900ba939a672ed47aa23505e8da755007548521ce6a297bb55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

Release history Release notifications | RSS feed

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

This release

1.0.0 This release

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page