liquid-rust icon indicating copy to clipboard operation
liquid-rust copied to clipboard

feat(lib): Add render tag

Open YuiYukihira opened this issue 3 years ago • 0 comments

Hey, here's my PR for #471.

See the description including

  • the selected template cannot access any variables from the parent scope
    • I've created a new OpaqueStackFrame struct, I needed a way to make sure that only the variables passed into the render tag could be accessed from inside it.
  • the selected template's variables do not leak into the parent scope
  • variables can be passed to the template with either key: value syntax or with with <var> [as <var>]
  • rendered content can be looped over with for <value> [as <var>] and the template has access to forloop
    • I moved the ForloopObject and Range structs into a parent module, this is because I wanted to use them for the for variant of the render tag.

YuiYukihira avatar Jun 22 '22 23:06 YuiYukihira