Skip to content

Instantly share code, notes, and snippets.

@CharlotteGore
Created October 25, 2013 17:00
Show Gist options
  • Save CharlotteGore/7158057 to your computer and use it in GitHub Desktop.
Save CharlotteGore/7158057 to your computer and use it in GitHub Desktop.
// in app initialisation
var views = new HyperboneView()
.registerHelper('parser', require('marked'))
.registerHelper('date', require('date-formating-module'));
// test data..
var html = dom('<div>{{ parser( ProductDescription )}}</div>');
var model = new HyperboneModel({ ProductDescription : "__hello world__" });
// done automatically in a route handler...
views.createView( model, html );
parser( ProductDescription )->
parser( get("ProductDescription") ) -> p
parser( "__hello world__" ) ->
"<p><strong>hello world</strong></p>" ->
<div><p><strong>hello world</strong></p></strong>
model.set("ProductDescription", "lol") ->
<div><p>lol</p></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment