hogan.jsx
Synopsis
This is a JSX version of JavaScript templating library Hogan. Original Hogan and this Hogan.jsx implement Mustache template syntax. You can read detail syntax at here.
This project is aming following features:
- Genrerate JS Function object
- Genrerate JSX script from Mustache formating templates (not tested yet).
Code Example
;; static : void { var data = weather: "a sunny day!" : variant; var template = Hogan; var output = template; // prints "Today's wheather is a sunny day!" console; }
Installation
$ npm install hogan.jsx
API Reference
-
static Hogan.compile(src : string) : Template
Generate Template object.
-
static Hogan.compileToJSX(src : string) : string
Generate Template instance source code in JSX.
-
Template.render(context : variant) : string
Generate converted text.
Development
Repository
- Repository: git://github.com/shibukawa/hogan.jsx.git
- Issues: https://github.com/shibukawa/hogan.jsx.git/issues
Run Test
$ grunt test
Build
# Generate API reference $ grunt doc # Build application or library for JS project $ grunt build
Author
- Yoshiki Shibukawa / yoshiki@shibu.jp
License
MIT
Complete license is written in LICENSE.md
.
Original License
Copyright 2011 Twitter, Inc.
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0