File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -118,15 +118,21 @@ def node_render(context):
118118
119119 return tag_func
120120
121+ # have to export the original jinja visit Extends
122+ # in the case jinja tags are being overriden
121123jinja_visit_Extends = None
122124
123125def override_jinja_tags ():
126+ """
127+ Overrides jinja extends and include tags for use in your pattern library.
128+ Call it in your settings to override tags
129+ """
124130 global jinja_visit_Extends
125131 try :
126132 from jinja2 .compiler import CodeGenerator as JinjaCodeGenerator
127133 from jinja2 .environment import Template as JinjaTemplate
128134 except ModuleNotFoundError :
129- ModuleNotFoundError ("install jinja2 to override tags" )
135+ ModuleNotFoundError ("install jinja2 to override jinja tags" )
130136
131137 from .loader_tags import template_new_context , visit_extends
132138 jinja_visit_Extends = JinjaCodeGenerator .visit_Extends
You can’t perform that action at this time.
0 commit comments