Templating engine #40

Open
opened 2022-11-19 11:54:08 +00:00 by heartles · 0 comments
Owner

We need a templating engine for implementing server-side rendered HTML pages.

A basic one is partially implemented in the template package. Current features:

  • Text substitution
  • For loops over slices/iterables
  • If conditionals over booleans
  • Whitespace stripping around control blocks
  • else for if statements (#62)
  • If for optionals/error unions ({#if .optional_arg |$arg|})
  • Support for loop joiners (put in between each loop iteration - what syntax?)
  • Reusable subtemplates ({#template my_subtemplate .subtemplate_arg}) (#63)
  • Context that gets passed down implicitly (#64)
  • Loop iteration variable capture in for loops ({#for .arr |$v, $i|})
  • Iterator indexing syntax ({.arr[0]})
  • Custom format functions ({#call fmt .my_int "2>0"} or {#call formatIso8601 .my_date} - workshop syntax
We need a templating engine for implementing server-side rendered HTML pages. A basic one is partially implemented in the `template` package. Current features: - [x] Text substitution - [x] For loops over slices/iterables - [x] If conditionals over booleans - [x] Whitespace stripping around control blocks - [x] `else` for if statements (#62) - [x] If for optionals/error unions (`{#if .optional_arg |$arg|}`) - [ ] Support for loop joiners (put in between each loop iteration - what syntax?) - [x] Reusable subtemplates (`{#template my_subtemplate .subtemplate_arg}`) (#63) - [x] Context that gets passed down implicitly (#64) - [ ] Loop iteration variable capture in for loops (`{#for .arr |$v, $i|}`) - [ ] Iterator indexing syntax (`{.arr[0]}`) - [ ] Custom format functions (`{#call fmt .my_int "2>0"}` or `{#call formatIso8601 .my_date}` - workshop syntax
heartles added the
web
label 2022-11-21 10:40:32 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: heartles/fediglam#40
No description provided.