couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Buesing <ge...@geoffbuesing.com>
Subject [ann] mustache.couch.js: helper for streaming Mustache templates from list funs
Date Tue, 01 Nov 2011 14:36:31 GMT
Hi, just wanted to let everyone know that I released mustache.couch.js, a
helper for streaming Mustache templates from list funs.

I got tired of gluing together strings in my list funs, so I built this
helper, which allows me to keep separate template files with an inline row
partial, and wrap them in a normalized layout.html.

Resulting list funs are much cleaner.  Example:

function(head, req) {
  var template = require('vendor/mustache.couch').compile(this, 'notes');

  template.stream({title: 'Notes'}, function(row) {
    return row.doc;
  });
}

Code with example CouchApp and a detailed README are here:

https://github.com/gbuesing/mustache.couch.js

Hope this is useful to others. Feedback appreciated.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message