diff --git a/README.md b/README.md index 6ec64d2..1bfa613 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,105 @@ -# blitz -Templating Engine +# Cometa + +> Yet another templating engine 📠 + +Cometa is a templating engine with **no dependencies** written in `JS`. That was the reason because it was created. + +## Quickstart 💥 + +```bash +# Install +npm i cometa + +# Run +node examples/simple/app.js +``` + +## Setup 🏗 + +### General Import + +```javascript +// Import +const Cometa = require('cometa') + +// Initialize +const cometa = new Cometa() +``` + +### Constructor parameters + +- `views` [Optional] Root template folder +- `extension` [Optional] File extension for the templates +- `encoding` [Optional] Encoding to be used on the + +```javascript +new Cometa({ + views: './my/views/folder', + extension: 'html' +}) +``` + +## Installation 🚂 + +```bash +npm i cometa +``` + +## Reference 📒 + +### Variable + +```json +{myVar: "ok"} +``` + +```html +{{myVar}} +``` + +### Comments + +```html +
+ {{# Me Me Comment #}} +
+``` + +### If + +True is everything that is different from: + +- `undefined` +- `false` +- `null` +- `''` + +```json +{ myVar: 'something'|true|[1,2,3]|42|...} +``` + +```html +{{? myVar }} + Only show me when I exist: {{ myVar }} +{{/?}} +``` + +### Loop + +```json +{ + links: [ + {id:0, name: "One"}, + {id:1, name: "Two"}, + {id:2, name: "Three"} + ] +} +``` + +```html + +``` \ No newline at end of file