Skip to content

esoterra/template-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wasm Template Compiler

A compiler from templates to minimal Wasm Components

Crates.io version Download docs.rs docs

build status

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 with a single export function that takes in parameters and returns the resulting template output string.

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.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published