From 6e5a6fbf626ec54099c4badfc544a14414672724 Mon Sep 17 00:00:00 2001 From: David Fenster Date: Tue, 27 Mar 2012 09:40:15 -0400 Subject: [PATCH 1/6] added vash --- lib/languages/vash.js | 24 ++++++++++++++++++++++++ lib/templates/vash/simple.html | 16 ++++++++++++++++ package.json | 3 ++- 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 lib/languages/vash.js create mode 100644 lib/templates/vash/simple.html diff --git a/lib/languages/vash.js b/lib/languages/vash.js new file mode 100644 index 0000000..a9381b0 --- /dev/null +++ b/lib/languages/vash.js @@ -0,0 +1,24 @@ +var vash = require('vash'), + fs = require('fs'), + data = { + header: 'Colors', + items: [ + {name: 'red', current: true, url: '#Red'}, + {name: 'green', current: false, url: '#Green'}, + {name: 'blue', current: false, url: '#Blue'} + ] + }, + files = { + simple: fs.readFileSync(__dirname + '/../templates/vash/simple.html', 'utf8') + }, + tpl = {}; + +exports.compile = function (type, callback) { + tpl[type] = vash.compile(files[type]); + callback(); +}; + +exports.render = function (type, callback) { + tpl[type](data); + callback(); +}; diff --git a/lib/templates/vash/simple.html b/lib/templates/vash/simple.html new file mode 100644 index 0000000..f8d0d34 --- /dev/null +++ b/lib/templates/vash/simple.html @@ -0,0 +1,16 @@ +

@model.header

+@if(model.items.length) { + +} +@if (model.items.length == 0) { +

The list is empty.

+} diff --git a/package.json b/package.json index 69c9008..57f082d 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "mu2": "0.5.3", "swig": "0.7.0", "Templ8": "0.2.1", - "whiskers": "0.1.0" + "whiskers": "0.1.0", + "vash": "=0.3.1-327" }, "main": "index", "engines": { From 31b3093d5b9e828507b0806d6b44f1acf89ac739 Mon Sep 17 00:00:00 2001 From: David Fenster Date: Tue, 27 Mar 2012 09:58:13 -0400 Subject: [PATCH 2/6] fixed package.json for vash --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 57f082d..632d9a2 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "swig": "0.7.0", "Templ8": "0.2.1", "whiskers": "0.1.0", - "vash": "=0.3.1-327" + "vash": "0.3.1-327" }, "main": "index", "engines": { From 947c8fe43bb03faa65013dcea6242e00f0da0619 Mon Sep 17 00:00:00 2001 From: Andrew Petersen Date: Tue, 27 Mar 2012 11:29:08 -0400 Subject: [PATCH 3/6] adding Vash to feature grid --- index.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/index.html b/index.html index 3094fe7..9eafa6e 100644 --- a/index.html +++ b/index.html @@ -38,6 +38,7 @@

Template Languages (alphabetical)

  • Mu2 - A Mustache template engine for Node.js.
  • Swig - Swig is a template engine inspired by the Django syntax.
  • Templ8 - JavaScript client/server template engine.
  • +
  • Vash - The 60 billion double-dollar template-maker. Razor syntax, for JS.
  • Whiskers - A mustachioed templating library.
  • @@ -59,6 +60,7 @@

    Feature Comparisons

    Mu2 Swig Templ8 + Vash Whiskers @@ -75,6 +77,7 @@

    Feature Comparisons

    + Browser Support @@ -88,6 +91,7 @@

    Feature Comparisons

    + Available via npm @@ -101,6 +105,7 @@

    Feature Comparisons

    + Variable Filters @@ -114,6 +119,7 @@

    Feature Comparisons

    + Shorthand HTML Syntax @@ -127,6 +133,7 @@

    Feature Comparisons

    +
  • Extends / Block Template Inheritance @@ -140,6 +147,7 @@

    Feature Comparisons

    +
  • Escapes Output @@ -153,6 +161,7 @@

    Feature Comparisons

    + Iteration @@ -166,6 +175,7 @@

    Feature Comparisons

    + if/else Conditionals @@ -179,6 +189,7 @@

    Feature Comparisons

    + else if Conditionals @@ -191,6 +202,7 @@

    Feature Comparisons

    + @@ -205,6 +217,7 @@

    Feature Comparisons

    + Partials / Includes @@ -218,6 +231,7 @@

    Feature Comparisons

    + From d906e8eb073b4db147ba6ef14662d4e22ec4672a Mon Sep 17 00:00:00 2001 From: David Fenster Date: Tue, 27 Mar 2012 12:40:55 -0400 Subject: [PATCH 4/6] updated readme for vash --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fce97dd..e872fb9 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ View all feature comparisons and templates on the [Node Templates Page](http://p * [mu2@0.5.3](https://github.com/raycmorgan/Mu) * [swig@0.5.0](https://github.com/paularmstrong/swig) * [Templ8@0.2.1](https://github.com/constantology/Templ8) +* [Vash@0.3.1-327](https://github.com/kirbysayshi/Vash) ## Running From 8e4b302bc0a2e35948f6816ed0e8302f42266833 Mon Sep 17 00:00:00 2001 From: David Fenster Date: Tue, 27 Mar 2012 12:42:52 -0400 Subject: [PATCH 5/6] spaces instead of tabs --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 632d9a2..869ea62 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "swig": "0.7.0", "Templ8": "0.2.1", "whiskers": "0.1.0", - "vash": "0.3.1-327" + "vash": "0.3.1-327" }, "main": "index", "engines": { From 9ba42fea8fb1cfb918bffe5428aa50669e06e0c1 Mon Sep 17 00:00:00 2001 From: David Fenster Date: Tue, 27 Mar 2012 12:43:46 -0400 Subject: [PATCH 6/6] alphabetical order --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 869ea62..020836a 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,8 @@ "mu2": "0.5.3", "swig": "0.7.0", "Templ8": "0.2.1", - "whiskers": "0.1.0", - "vash": "0.3.1-327" + "vash": "0.3.1-327", + "whiskers": "0.1.0" }, "main": "index", "engines": {