https://github.com/webpro/requirejs-hogan
Simple Hogan plugin for RequireJS
https://github.com/webpro/requirejs-hogan
Last synced: 7 months ago
JSON representation
Simple Hogan plugin for RequireJS
- Host: GitHub
- URL: https://github.com/webpro/requirejs-hogan
- Owner: webpro
- Created: 2013-06-01T14:17:42.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2015-01-29T22:49:25.000Z (about 11 years ago)
- Last Synced: 2025-02-24T20:04:46.409Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 124 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# requirejs-hogan
Simple Hogan plugin for RequireJS.
* Requires the official `text!` plugin.
* Like the offical `text!` plugin, include the file extension in the module id.
* Make sure to include `template.js` from Hogan in your build (instead of e.g. `hogan-2.0.0.amd.js`).
## Example usage
define(['hgn!myTemplate.tpl'], function(myTemplate) {
var html = myTemplate.render({name:'John Doe'});
});
## Example config
require.config({
paths: {
'text': 'lib/requirejs-text/text',
'hogan': 'lib/hogan/web/builds/2.0.0/hogan-2.0.0.amd',
'hgn': 'lib/requirejs-hogan/hgn'
},
shim: {
'hogan': {
exports: 'Hogan'
}
}
});