From user-return-18644-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Tue Nov 1 23:12:18 2011 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 0AF867D25 for ; Tue, 1 Nov 2011 23:12:18 +0000 (UTC) Received: (qmail 99597 invoked by uid 500); 1 Nov 2011 23:12:14 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 99551 invoked by uid 500); 1 Nov 2011 23:12:14 -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 99518 invoked by uid 99); 1 Nov 2011 23:12:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2011 23:12:14 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of alex.barbalex@gmail.com designates 209.85.212.44 as permitted sender) Received: from [209.85.212.44] (HELO mail-vw0-f44.google.com) (209.85.212.44) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2011 22:52:09 +0000 Received: by vws5 with SMTP id 5so7441950vws.31 for ; Tue, 01 Nov 2011 15:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=XALpHqnu2XkdeF1YJYQC8D7xVbfWPOgcAnXiKm5Y8As=; b=Z27L8TStjeNYQxe7p8tM9a2h6Rz33ueiCfCCi4aAcfgr/su27GtKkJTnv8LZMfLnN+ kvXsPL3QkX6r2dlm6z1KwQY/AAY0pI2pCJnWOTw5iFkEsMjVjG81ovomxmr+i2RILgfV ZcfVLgg8WO2HkhkP1MPJL/XN0ABmRyIPSopqc= MIME-Version: 1.0 Received: by 10.52.94.102 with SMTP id db6mr97046vdb.118.1320187908002; Tue, 01 Nov 2011 15:51:48 -0700 (PDT) Sender: alex.barbalex@gmail.com Received: by 10.52.114.196 with HTTP; Tue, 1 Nov 2011 15:51:47 -0700 (PDT) In-Reply-To: References: Date: Tue, 1 Nov 2011 23:51:47 +0100 X-Google-Sender-Auth: 4h69qIoBKl7gaz1bk6LoeH4Ce-M Message-ID: Subject: Re: [ann] mustache.couch.js: helper for streaming Mustache templates from list funs From: Alexander Gabriel To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org awesome much appreciated Alex 2011/11/1, Geoff Buesing : > 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. > -- ***************************************************************** Alexander Gabriel Wiesenstrasse 22 8800 Thalwil 079/ 372 51 64 alex@barbalex.ch ww.barbalex.ch