Replies: 1 comment
-
|
Python liquid2 (separate repository) has been released. It incorporates many of the API changes discussed here. See the migration guide's API changes section. Some of these API changes can still be applied to this project, but we'll take a more conservative approach than that seen in Python Liquid2. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is a list of API changes planned for Python Liquid version 2.0. Work has not yet begun on version 2.0. Suggestions are welcome.
env: Environmentargument toliquid.Contextwithtemplate: BoundTemplate. The current environment can be accessed through the template object.templateto theliquid.Contextconstructor to be keyword only arguments.liquid.Contexttoliquid.RenderContextto differentiate it fromLoadContextand any other "contexts" that crop up.VariableCaptureContexttoCaptureRenderContext.MarkupSafea required dependency, even if HTML auto escaping is disabled.liquid.token.Tokenfrom(linenum, type, value)to(kind, value, index, source, source_name), wheretypehas been renamed tokind,indexis the index of the start of the token insource(template source text), andsource_nameis the name associated with the source text. This is done in the name of better error reporting, especially when reporting errors from included, rendered or extended templates.liquid.exceptions.Error, to require atoken(as described above) argument instead of optionallinenumandfilename.liquid.ast.Nodeconstructor to require atoken: Tokenargument. At the moment it is just a convention.liquid.Environment. Instead, all template caches should be implemented in template loaders, or mixed in to simpler template loaders.get_template,get_template_with_contextand theirasyncversions in toget_templatewith an optionalcontextargument.Environmentconstructor arguments to class attributes.Environmentcustomisation would be achieved by subclassing.2024/01/30
list_templates()toBaseLoader.2024/10/06
children()is now a required method ofast.Nodeandexpression.Expression.Beta Was this translation helpful? Give feedback.
All reactions