SemtexJS: Semantic Text Templating Engine
Semtex is a html templating engine.
All major changes are documented in the
changelog
Quick start
The first step is to define a template:
html:
head:
meta[name="keywords",content="HTML,CSS,XML,JavaScript"]:
title: {{title}}
body:
p: Hello, {{message}}!
div:
lots of lovely content
to be placed here...
Once the template source code has been defined, the next step is to compile it into a render function. The actual template can be loaded any way you desire, providing that when it enters the
compile() function it's a
string:
var render = semtex.compile(src);
Now, all that's left to do is render the template into html, passing in any data the template requires:
var html = render({
title: 'Semtex example',
message: 'Semtex'
});
Which, given the template definition above, will produce the following output:
Semtex example
Hello, Semtex!
lots of lovely content to be placed here...
Documentation
> Coming soon...
Installation
$3
npm install semtex
$3
https://github.com/garydouble/semtex/releases
$3
UMD based files are located in the
dist folder:
semtex.js
Uncompressed development version.
semtex.min.js
Minified production version.
Both development and production files have source maps provided.
Issues and Contributions
https://github.com/garydouble/semtex/issues
Issues, feedback and pull requests all welcome.
Happy Coding!