{"repo":"mikeckennedy/jinja_partials","free":true,"listed":false,"github":"https://github.com/mikeckennedy/jinja_partials","clone":"git clone https://github.com/mikeckennedy/jinja_partials.git","description":"Simple reuse of partial HTML page templates in the Jinja template language for Python web frameworks. #pypackage","language":"Python","stars":237,"topics":["jinja2","flask","html","template-engine","python"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Jinja Partials Simple reuse of partial HTML page templates in the Jinja template language for Python web frameworks. (There is also a Pyramid/Chameleon version here.) Overview When building real-world web apps with Jinja2, it's easy to end up with repeated HTML fragments. Just like organizing code for reuse, it would be ideal to reuse smaller sections of HTML template code. That's what this library is all about. Documentation The full documentation is available at mkennedy.codes/docs/jinja-partials. Supported Frameworks Jinja Partials has specific support for the most popular Python web frameworks: - Flask - register extensions(app) - FastAPI - register fastapi extensions(app, templates) - Starlette - register starlette extensions(templates, app=app) - Quart - register quart extensions(app) - Any Jinja2 environment - register environment(env) Examples This project includes example applications for each supported framework in the examples folder: - Flask example - Traditional Flask app with partials - FastAPI example - FastAPI with Jinja2Templates - Starlette example - Starlette with Jinja2Templates - Quart example - Async Quart app with partials Each example demonstrates reusable partial templates. The screenshot below is from the Flask example: Installation It's just pip install jinja-partials and you're all set with this pure Python package. Requires Python 3.10 or newer (on older versions of Python, pip will install an earlier release that predates the FastAPI, Starlette, ","default_branch":null,"files":null,"tree":[],"storefront":"/r/mikeckennedy","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mikeckennedy/jinja_partials/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}