https://github.com/igelbox/schnurrbart
Minimal template mit {{schnurrbärte}} in JavaScript
https://github.com/igelbox/schnurrbart
Last synced: 10 months ago
JSON representation
Minimal template mit {{schnurrbärte}} in JavaScript
- Host: GitHub
- URL: https://github.com/igelbox/schnurrbart
- Owner: igelbox
- License: bsd-2-clause
- Created: 2013-12-26T18:24:56.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-01-30T20:24:28.000Z (over 12 years ago)
- Last Synced: 2025-03-06T13:47:26.817Z (over 1 year ago)
- Language: JavaScript
- Size: 148 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# schnurrbart.js - Logic-full {{schnurrbärte}} templates with JavaScript
## Usage
Below is quick example how to use schnurrbart.js:
```js
var model = {
name: 'Schreibikus',
sagen: function (name) {
return 'Hallo ' + name + '. Ich heisse ' + this.name + '.';
}
};
var output = schnurrbart("{{name}}: {{sagen('Welt')}}", model);
```
In this example, the `schnurrbart` function takes two parameters: 1) the schnurrbart template and 2) a `model` object that contains the data and code needed to render the template, and provides following `output`:
```
Schreibikus: Hallo Welt. Ich heisse Schreibikus.
```
-
published under the liberal terms of the BSD License, see the [LICENSE](LICENSE) file.