0.4.0 • Published 7 years ago

semtex v0.4.0

Weekly downloads
15
License
MIT
Repository
github
Last release
7 years ago

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:

<html>
  <head>
    <meta name="keywords" content="HTML,CSS,XML,JavaScript"/>
    <title>Semtex example</title>
  </head>
  <body>
    <p>Hello, Semtex!</p>
    <div>lots of lovely content to be placed here...</div>
  </body>
</html>

Documentation

Coming soon...

Installation

Install via NPM

npm install semtex

Download a release

https://github.com/garydouble/semtex/releases

Browsers

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!

0.4.0

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.2

8 years ago

0.0.1

10 years ago

0.0.0

10 years ago