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):
118
118
119
119
return tag_func
120
120
121
+ # have to export the original jinja visit Extends
122
+ # in the case jinja tags are being overriden
121
123
jinja_visit_Extends = None
122
124
123
125
def 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
+ """
124
130
global jinja_visit_Extends
125
131
try :
126
132
from jinja2 .compiler import CodeGenerator as JinjaCodeGenerator
127
133
from jinja2 .environment import Template as JinjaTemplate
128
134
except ModuleNotFoundError :
129
- ModuleNotFoundError ("install jinja2 to override tags" )
135
+ ModuleNotFoundError ("install jinja2 to override jinja tags" )
130
136
131
137
from .loader_tags import template_new_context , visit_extends
132
138
jinja_visit_Extends = JinjaCodeGenerator .visit_Extends
You can’t perform that action at this time.
0 commit comments