├── .gitignore ├── web ├── favicon.ico ├── images │ ├── logo.png │ ├── noise.png │ ├── stripes.png │ └── small-hogan-icon.png ├── builds │ ├── 1.0.4 │ │ ├── template-1.0.4.min.js │ │ ├── hogan-1.0.4.min.js │ │ ├── hogan-1.0.4.min.amd.js │ │ ├── hogan-1.0.4.min.common.js │ │ ├── hogan-1.0.4.min.mustache.js │ │ └── template-1.0.4.js │ ├── 2.0.0 │ │ ├── template-2.0.0.min.js │ │ ├── hogan-2.0.0.min.js │ │ ├── hogan-2.0.0.min.amd.js │ │ ├── hogan-2.0.0.min.common.js │ │ ├── hogan-2.0.0.min.mustache.js │ │ └── template-2.0.0.js │ ├── 1.0.5 │ │ ├── template-1.0.5.min.js │ │ ├── hogan-1.0.5.min.js │ │ ├── hogan-1.0.5.min.amd.js │ │ ├── hogan-1.0.5.min.common.js │ │ ├── hogan-1.0.5.min.mustache.js │ │ └── template-1.0.5.js │ ├── 3.0.2 │ │ ├── template-3.0.2.min.js │ │ ├── hogan-3.0.2.min.js │ │ └── hogan-3.0.2.min.amd.js │ ├── 3.0.1 │ │ ├── hogan.template-3.0.1.min.js │ │ ├── hogan.template-3.0.1.min.amd.js │ │ ├── hogan.template-3.0.1.min.common.js │ │ ├── hogan.template-3.0.1.min.mustache.js │ │ ├── hogan-3.0.1.min.js │ │ ├── hogan-3.0.1.min.amd.js │ │ └── hogan-3.0.1.min.common.js │ ├── 1.0.3 │ │ └── hogan.min.js │ └── 1.0.0 │ │ └── hogan.min.js ├── 1.0.0 │ └── hogan.min.js ├── index.html.mustache └── stylesheets │ └── layout.css ├── test ├── html │ └── list.html ├── templates │ └── list.mustache ├── phantom-js-loader.js ├── index.html ├── run.js ├── spec.js ├── specWithGet.js ├── hulk.js └── mustache.js ├── .npmignore ├── .travis.yml ├── .gitmodules ├── .editorconfig ├── wrappers ├── js.mustache ├── amd.js.mustache ├── common.js.mustache └── mustache.js.mustache ├── package.json ├── component.json ├── lib └── hogan.js ├── tools ├── web_templates.js └── release.js ├── Makefile ├── README.md └── bin └── hulk /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | -------------------------------------------------------------------------------- /web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelhelmick/hogan.js/master/web/favicon.ico -------------------------------------------------------------------------------- /web/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelhelmick/hogan.js/master/web/images/logo.png -------------------------------------------------------------------------------- /web/images/noise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelhelmick/hogan.js/master/web/images/noise.png -------------------------------------------------------------------------------- /web/images/stripes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelhelmick/hogan.js/master/web/images/stripes.png -------------------------------------------------------------------------------- /test/html/list.html: -------------------------------------------------------------------------------- 1 |
52 | Hogan.js is a 3.4k JS templating engine developed at Twitter. Use it as a part of your asset packager to compile templates ahead of time or include it in your browser to handle dynamic templates. 53 |
54 |55 | If you're developing with Node.js, just use NPM to add the Hogan package. 56 |
57 |$ npm install hogan.js
58 | 59 | Alternatively, drop hogan.js in your browser by adding the following script. 60 |
61 |<script src="http://twitter.github.com/hogan.js/builds/{{version}}/hogan-{{version}}.js"></script>
62 |
63 | 75 | Hogan.js was developed against the mustache test suite, so everything that holds true for templates as specified here, is also the case for hogan.js. 76 |
77 |78 | That means you get variables, sections, lambdas, partials, filters, and everything else you've come to expect from mustache templating - only much, much faster. 79 |
80 |
92 | Use hogan.compile() to precompile your templates into vanilla JS.
93 |
95 | It's best to serve your templates precompiled whenever you can (rather than the raw templates), as parsing is the most time consuming operation. 96 |
97 |98 |
99 |
111 | Once compiled, call the render() method with a context and optional partials object.
112 |
114 | If supplying partials, you can compile them ahead of time, or pass string templates.
115 |116 |
117 |130 | Hulk is Hogan's command line utility. Use it to easily compile your templates as js files. 131 |
132 |
133 | Hulk supports the * wildcard (even on windows) and allows you to target specific file extensions as well.
135 |
136 |