Metadata-Version: 2.4
Name: sphinx-jinja-variants
Version: 2026.11.2.1
Summary: Render Sphinx sources under scoped Jinja contexts.
Author-email: Adam Dangoor <adamdangoor@gmail.com>
License-Expression: MIT
Project-URL: Issues, https://github.com/adamtheturtle/sphinx-jinja-variants/issues
Project-URL: Source, https://github.com/adamtheturtle/sphinx-jinja-variants
Keywords: documentation,rst,sphinx
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: Sphinx :: Extension
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Requires-Python: >=3.12
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: docutils>=0.21.2
Requires-Dist: sphinx<10,>=9.1.1
Requires-Dist: sphinx-jinja2>=0.0.1
Requires-Dist: sphinx-section-include>=2026.11.2.4
Dynamic: license-file

|Build Status| |PyPI|

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

Render Sphinx compositions with temporary Jinja bindings and a prepared RST source.

.. code-block:: console

   $ pip install sphinx-jinja-variants

Use ``render_source_variant`` from a custom Sphinx directive.
It inherits the selected context's existing values, prepares the source once for standard ``include-section`` directives, runs your rendering callback, and restores the original bindings.
Your code chooses variants, content preparation, validation, and presentation.

See the `Python API <https://github.com/adamtheturtle/sphinx-jinja-variants/blob/main/API.rst>`_ and the `platform example <https://github.com/adamtheturtle/sphinx-jinja-variants/tree/main/sample/source>`_.
To contribute, see the `contributor guide <https://github.com/adamtheturtle/sphinx-jinja-variants/blob/main/CONTRIBUTING.rst>`_.

.. |Build Status| image:: https://github.com/adamtheturtle/sphinx-jinja-variants/actions/workflows/ci.yml/badge.svg?branch=main
   :target: https://github.com/adamtheturtle/sphinx-jinja-variants/actions
.. |PyPI| image:: https://badge.fury.io/py/sphinx-jinja-variants.svg
   :target: https://badge.fury.io/py/sphinx-jinja-variants
