--- id: sphinx-jinja version: "2.0.2" license: MIT license_treatment: permissive maintenance: dormant --- # sphinx-jinja — includes jinja templates in a documentation License: permissive · Maintenance: dormant · Downloads: 2.9M/mo ## What it is and what it does sphinx-jinja is a Sphinx extension that adds a jinja directive to reStructuredText, allowing you to embed Jinja2 template code directly in your documentation source. At build time, the extension renders these templates using contexts you define in your Sphinx conf.py, producing dynamic RST content that Sphinx then processes normally. You configure contexts, custom filters, tests, globals, and Jinja environment settings in your configuration file, then reference them by name in your RST directives. The extension is useful when your documentation needs to be generated from data structures, iterate over collections, or apply conditional logic—tasks that plain RST cannot express. You can inline templates in your RST files or load them from separate Jinja files using the file option. It also supports header-level management and debug output to inspect the generated RST before final rendering. Use it for: - Generate API documentation tables or lists by iterating over structured data in conf.py. - Conditionally include or exclude documentation sections based on configuration flags. - Apply custom formatting to template variables using Jinja filters. - Load and render reusable documentation templates from external Jinja files. - Maintain DRY documentation by templating repetitive content patterns. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A Sphinx extension that lets you embed Jinja2 templates directly into reStructuredText documentation, generating dynamic content at build time. Yes, if you need dynamic content generation in Sphinx and are comfortable with dormant maintenance. The package is stable, has no known vulnerabilities, and supports Python 3.6 through 3.10. However, because the last release was in 2022 and the repository has seen no commits since 2023-11-02, do not expect bug fixes or compatibility updates for future Sphinx or Python releases. Suitable for established projects where the feature set is complete; risky for new projects requiring ongoing support. ## Install pip install sphinx-jinja uv add sphinx-jinja poetry add sphinx-jinja ## Installing sphinx-jinja Before you install: Low friction install with three stable dependencies. Maintenance is dormant—last release was 2022-07-05 and no commits since 2023-11-02—so expect no active support, though the package remains functional for current Python versions. License in practice: MIT license is permissive, allowing use in commercial and private projects with minimal restrictions. Quickstart: pip install sphinx-jinja In conf.py: extensions = ['sphinx_jinja'] jinja_contexts = {'ctx': {'items': ['a', 'b']}} In your .rst file: .. jinja:: ctx {% for item in items %} - {{ item }} {% endfor %} Requires Sphinx, Jinja2, and docutils to be installed; Python >=3.6,<4 required. Verify before relying: - Whether the package works reliably with recent Sphinx versions beyond 2022. - Community activity or third-party maintenance status beyond the original repository. - Compatibility with Python versions released after the last package update. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 2.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags sphinx jinja template extension, dynamic documentation generation, jinja in sphinx docs, template-based rst content, sphinx template directive, template-engine, documentation-generation [View on SkillFed](https://skillfed.io/packages/sphinx-jinja) · [View on PyPI](https://pypi.org/project/sphinx-jinja/)