Skip to content

Commit

Permalink
fix documentation for template engine plugins; fixes quirkey#100
Browse files Browse the repository at this point in the history
  • Loading branch information
endor committed Jul 6, 2012
1 parent 9e980dd commit 8559311
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 50 deletions.
5 changes: 4 additions & 1 deletion lib/plugins/sammy.haml.js
Expand Up @@ -27,7 +27,7 @@
//
// The app:
//
// var $.app = $.sammy(function() {
// var app = $.sammy(function() {
// // include the plugin
// this.use(Sammy.Haml);
//
Expand All @@ -38,7 +38,10 @@
// // render the template and pass it through haml
// this.partial('mytemplate.haml');
// });
// });
//
// $(function() {
// app.run()
// });
//
// If I go to `#/hello/AQ` in the browser, Sammy will render this to the `body`:
Expand Down
38 changes: 21 additions & 17 deletions lib/plugins/sammy.handlebars.js
Expand Up @@ -20,13 +20,13 @@
//
// The template (mytemplate.hb):
//
// <h1>\{\{title\}\}<h1>
// <h1>{{title}}<h1>
//
// Hey, {{name}}! Welcome to Handlebars!
//
// The app:
//
// var $.app = $.sammy(function() {
// var app = $.sammy(function() {
// // include the plugin and alias handlebars() to hb()
// this.use('Handlebars', 'hb');
//
Expand All @@ -37,7 +37,10 @@
// // render the template and pass it through handlebars
// this.partial('mytemplate.hb');
// });
// });
//
// $(function() {
// app.run()
// });
//
// If I go to #/hello/AQ in the browser, Sammy will render this to the <tt>body</tt>:
Expand All @@ -60,27 +63,28 @@
//
// The app:
//
// var $.app = $.sammy(function() {
// var app = $.sammy(function() {
// // include the plugin and alias handlebars() to hb()
// this.use('Handlebars', 'hb');
//
// this.get('#/hello/:name/to/:friend', function() {
// var context = this;
//
// this.get('#/hello/:name/to/:friend', function(context) {
// // fetch handlebars-partial first
// $.get('mypartial.hb', function(response){
// context.partials = response;
//
// // set local vars
// context.name = this.params.name;
// context.hello_friend = {name: this.params.friend};
//
// // render the template and pass it through handlebars
// context.partial('mytemplate.hb');
// });
// this.load('mypartial.hb')
// .then(function(partial) {
// // set local vars
// context.partials = {hello_friend: partial};
// context.name = context.params.name;
// context.friend = context.params.friend;
//
// // render the template and pass it through handlebars
// context.partial('mytemplate.hb');
// });
// });
//
// });
//
// $(function() {
// app.run()
// });
//
// If I go to #/hello/AQ/to/dP in the browser, Sammy will render this to the <tt>body</tt>:
//
Expand Down
36 changes: 20 additions & 16 deletions lib/plugins/sammy.hogan.js
Expand Up @@ -22,13 +22,13 @@
//
// The template (mytemplate.hg):
//
// <h1>\{\{title\}\}<h1>
// <h1>{{title}}<h1>
//
// Hey, {{name}}! Welcome to Mustache!
//
// The app:
//
// var $.app = $.sammy(function() {
// var app = $.sammy(function() {
// // include the plugin and alias hogan() to hg()
// this.use('Hogan', 'hg');
//
Expand All @@ -39,7 +39,10 @@
// // render the template and pass it through hogan
// this.partial('mytemplate.hg');
// });
// });
//
// $(function() {
// app.run()
// });
//
// If I go to #/hello/AQ in the browser, Sammy will render this to the <tt>body</tt>:
Expand All @@ -62,26 +65,27 @@
//
// The app:
//
// var $.app = $.sammy(function() {
// var app = $.sammy(function() {
// // include the plugin and alias hogan() to hg()
// this.use('Hogan', 'hg');
//
// this.get('#/hello/:name/to/:friend', function() {
// var context = this;
//
// this.get('#/hello/:name/to/:friend', function(context) {
// // fetch hogan-partial first
// $.get('mypartial.hg', function(response){
// context.partials = response;
//
// // set local vars
// context.name = this.params.name;
// context.hello_friend = {name: this.params.friend};
//
// // render the template and pass it through hogan
// context.partial('mytemplate.hg');
// });
// this.load('mypartial.hg')
// .then(function(partial) {
// // set local vars
// context.partials = {hello_friend: partial};
// context.name = context.params.name;
// context.friend = context.params.friend;
//
// // render the template and pass it through hogan
// context.partial('mytemplate.hg');
// });
// });
// });
//
// $(function() {
// app.run()
// });
//
// If I go to #/hello/AQ/to/dP in the browser, Sammy will render this to the <tt>body</tt>:
Expand Down
36 changes: 20 additions & 16 deletions lib/plugins/sammy.mustache.js
Expand Up @@ -22,13 +22,13 @@
//
// The template (mytemplate.ms):
//
// <h1>\{\{title\}\}<h1>
// <h1>{{title}}<h1>
//
// Hey, {{name}}! Welcome to Mustache!
//
// The app:
//
// var $.app = $.sammy(function() {
// var app = $.sammy(function() {
// // include the plugin and alias mustache() to ms()
// this.use('Mustache', 'ms');
//
Expand All @@ -39,7 +39,10 @@
// // render the template and pass it through mustache
// this.partial('mytemplate.ms');
// });
// });
//
// $(function() {
// app.run()
// });
//
// If I go to #/hello/AQ in the browser, Sammy will render this to the <tt>body</tt>:
Expand All @@ -62,26 +65,27 @@
//
// The app:
//
// var $.app = $.sammy(function() {
// var app = $.sammy(function() {
// // include the plugin and alias mustache() to ms()
// this.use('Mustache', 'ms');
//
// this.get('#/hello/:name/to/:friend', function() {
// var context = this;
//
// this.get('#/hello/:name/to/:friend', function(context) {
// // fetch mustache-partial first
// $.get('mypartial.ms', function(response){
// context.partials = response;
//
// // set local vars
// context.name = this.params.name;
// context.hello_friend = {name: this.params.friend};
//
// // render the template and pass it through mustache
// context.partial('mytemplate.ms');
// });
// this.load('mypartial.ms')
// .then(function(partial) {
// // set local vars
// context.partials = {hello_friend: partial};
// context.name = context.params.name;
// context.friend = context.params.friend;
//
// // render the template and pass it through mustache
// context.partial('mytemplate.ms');
// });
// });
// });
//
// $(function() {
// app.run()
// });
//
// If I go to #/hello/AQ/to/dP in the browser, Sammy will render this to the <tt>body</tt>:
Expand Down

0 comments on commit 8559311

Please sign in to comment.