-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [#1] add possibility to override env Also provides an example of how to implement a custom loader Fixes #1 * update docs to match new endpoint filename * add doc about custom loader * fix link
- Loading branch information
Showing
3 changed files
with
35 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
""" | ||
This is an example of how to extend the default environment | ||
and/or loader to add your own filter logic. | ||
""" | ||
import jinja2 | ||
from j2lint import main, AbsolutePathLoader | ||
|
||
filters = ['to_nice_json'] | ||
|
||
env = jinja2.Environment(loader=AbsolutePathLoader()) | ||
env.filters.update({name: lambda: None for name in filters}) | ||
|
||
main(env=env) |
This file contains 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