File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -97,15 +97,21 @@ def node_render(context):
97
97
98
98
return tag_func
99
99
100
+ # have to export the original jinja visit Extends
101
+ # in the case jinja tags are being overriden
100
102
jinja_visit_Extends = None
101
103
102
104
def override_jinja_tags ():
105
+ """
106
+ Overrides jinja extends and include tags for use in your pattern library.
107
+ Call it in your settings to override tags
108
+ """
103
109
global jinja_visit_Extends
104
110
try :
105
111
from jinja2 .compiler import CodeGenerator as JinjaCodeGenerator
106
112
from jinja2 .environment import Template as JinjaTemplate
107
113
except ModuleNotFoundError :
108
- ModuleNotFoundError ("install jinja2 to override tags" )
114
+ ModuleNotFoundError ("install jinja2 to override jinja tags" )
109
115
110
116
from .loader_tags import template_new_context , visit_extends
111
117
jinja_visit_Extends = JinjaCodeGenerator .visit_Extends
You can’t perform that action at this time.
0 commit comments