Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E850579F6 for ; Tue, 1 Nov 2011 14:37:00 +0000 (UTC) Received: (qmail 37258 invoked by uid 500); 1 Nov 2011 14:36:59 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 37213 invoked by uid 500); 1 Nov 2011 14:36:59 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 37205 invoked by uid 99); 1 Nov 2011 14:36:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2011 14:36:59 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FROM_12LTRDOM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.214.52] (HELO mail-bw0-f52.google.com) (209.85.214.52) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2011 14:36:54 +0000 Received: by bkbc12 with SMTP id c12so5433201bkb.11 for ; Tue, 01 Nov 2011 07:36:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.141.8 with SMTP id k8mr15610937bku.14.1320158191842; Tue, 01 Nov 2011 07:36:31 -0700 (PDT) Received: by 10.204.102.211 with HTTP; Tue, 1 Nov 2011 07:36:31 -0700 (PDT) Date: Tue, 1 Nov 2011 09:36:31 -0500 Message-ID: Subject: [ann] mustache.couch.js: helper for streaming Mustache templates from list funs From: Geoff Buesing To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0015175cd5fe12770e04b0ad4819 --0015175cd5fe12770e04b0ad4819 Content-Type: text/plain; charset=ISO-8859-1 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. --0015175cd5fe12770e04b0ad4819--