Skip to content

Compile HTML templates to OCaml modules to generate consistent web sites.

License

Notifications You must be signed in to change notification settings

Chris00/weberizer

Repository files navigation

Continuous Integration

Weberizer

Weberizer is a simple templating engine for OCaml. It compiles the template to an OCaml module, providing an easy way to set the variables and render the template. String values are automatically escaped according to the context of the template in which they appear. You can add you own functions to the generated module — for example to set several related variables at once (you can also hide those variables from the interface if desired).

This approach will enable to easily add some security features if desired — like forcing several variables to be set before the template can be rendered.

Installation

The simplest way to install this library and program is to use opam:

opam install weberizer

The program to transform HTML files is called weberizer. Issue weberizer templ.html to generate templ.ml and templ.mli. The templating “variables” are described at the beginning of weberizer.mli (also available in HTML). See also the example.

Licence

This library is released under the LGPL-3.0 with the OCaml linking exception.

About

Compile HTML templates to OCaml modules to generate consistent web sites.

Resources

License

Stars

Watchers

Forks

Packages

No packages published