template-compiler

Crates.iotemplate-compiler
lib.rstemplate-compiler
version0.1.1
sourcesrc
created_at2024-05-10 04:45:12.907629
updated_at2024-05-10 04:45:12.907629
descriptionA compiler from a simple template language to Wasm components
homepage
repositoryhttps://github.com/esoterra/template-compiler
max_upload_size
id1235689
size92,222
Robin Brown (esoterra)

documentation

README

Wasm Template Compiler

This project compiles template files based on Nunjucks to WebAssembly (Wasm) Components.

It is very much a work in progress and the current compiler simply generates a component that prints out the entire template input.

Features will be progressively added, tentatively in this order:

  • Parameter interpolation
  • Conditional rendering
  • Repeated rendering
  • Dotted/nested parameter names
  • Filters
  • Async/streams?

Try it out

Invoke the compiler like this to generate a component for a template.

cargo run -- -i <input-path> -o <destination-path>

Examples

The best examples are currently the runtime tests, with the most interesting one being the "website" test.

Commit count: 19

cargo fmt