fix: implement dynamic template loader for include functionality - #14
Merged
Conversation
- Add 'loader' feature to minijinja dependency for dynamic template loading - Implement lazy template loader using env.set_loader() in renderer - Template loader uses TemplateContext to resolve relative paths - Security: blocks absolute paths and parent traversal unless --trust mode - Add comprehensive test suite with 12 integration tests covering: * Basic include functionality * Nested includes (multiple levels) * Include from subdirectories * Environment variables in included templates * Security restrictions (parent directory and absolute path blocking) * Trust mode allowing parent directory access * Conditional includes * Error handling for missing templates - Add test fixtures for include templates and expected outputs - All 267 tests passing (251 unit + 12 integration + 4 doc tests) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #14 +/- ##
==========================================
+ Coverage 86.51% 86.91% +0.39%
==========================================
Files 15 15
Lines 497 512 +15
==========================================
+ Hits 430 445 +15
Misses 67 67 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Replace Tera references with MiniJinja throughout README - Update template engine description to mention Jinja2 compatibility - Update documentation links to point to MiniJinja and Jinja2 docs - Change "Full Tera Syntax" to "Full Jinja2 Syntax" in features MiniJinja is the new template engine as documented in MINIJINJA_MIGRATION.md. It provides better Jinja2 compatibility and smaller binary size.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.