liquid.exts.ext
liquid.exts.ext
Provides a base extension class
LiquidExtension— A base extension class for extensions in this package to extend</>
liquid.exts.ext.LiquidExtension(environment)
A base extension class for extensions in this package to extend
__init_subclass__()— Initalize the tags and raw_tags using tag manager</>attr(name,lineno)(ExtensionAttribute) — Return an attribute node for the current extension. This is usefulto pass constants on extensions to generated template code. </>bind(environment)(te.Self) — Create a copy of this extension bound to another environment.</>call_method(name,args,kwargs,dyn_args,dyn_kwargs,lineno)(Call) — Call a method of the extension. This is a shortcut for:meth:attr+ :class:jinja2.nodes.Call. </>filter_stream(stream)(Union(tokenstream, iterable of token)) — It's passed a :class:~jinja2.lexer.TokenStreamthat can be usedto filter tokens returned. This method has to return an iterable of :class:~jinja2.lexer.Token\s, but it doesn't have to return a :class:~jinja2.lexer.TokenStream. </>parse(parser)(Node) — Let tag manager to parse the tags that are being listened to</>preprocess(source,name,filename)(str) — Try to keep the tag body raw by encode the variable/comment/blockstart strings ('{{', '{#', '{%') so that the body won't be tokenized by jinjia. </>
bind(environment) → te.Self
Create a copy of this extension bound to another environment.
filter_stream(stream) → Union(tokenstream, iterable of token)
It's passed a :class:~jinja2.lexer.TokenStream that can be usedto filter tokens returned. This method has to return an iterable of
:class:~jinja2.lexer.Token\s, but it doesn't have to return a
:class:~jinja2.lexer.TokenStream.
attr(name, lineno=None) → ExtensionAttribute
Return an attribute node for the current extension. This is usefulto pass constants on extensions to generated template code.
::
self.attr('_my_attribute', lineno=lineno)
call_method(name, args=None, kwargs=None, dyn_args=None, dyn_kwargs=None, lineno=None) → Call
Call a method of the extension. This is a shortcut for:meth:attr + :class:jinja2.nodes.Call.
__init_subclass__()
Initalize the tags and raw_tags using tag manager
preprocess(source, name, filename) → str
Try to keep the tag body raw by encode the variable/comment/blockstart strings ('{{', '{#', '{%') so that the body won't be tokenized by jinjia.
parse(parser) → Node
Let tag manager to parse the tags that are being listened to