From: Mike Taylor Date: Mon, 29 Jun 2015 19:02:46 +0000 (+0100) Subject: Part of ACREP-32. X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=8075369ec49fde2321be3dc4265ff7016a86481d;p=mkws-moved-to-github.git Part of ACREP-32. Add new Handlebars helper mkws-indexplus. Emits the current index in an iteration, plus a constant. --- diff --git a/src/mkws-handlebars.js b/src/mkws-handlebars.js index 3a59e9c..27975cd 100644 --- a/src/mkws-handlebars.js +++ b/src/mkws-handlebars.js @@ -122,6 +122,10 @@ Handlebars.registerHelper('mkws-index1', function(obj) { return obj.data.index + 1; }); +Handlebars.registerHelper('mkws-indexplus', function(delta, obj) { + return obj.data.index + delta; +}); + Handlebars.registerHelper('mkws-repeat', function(count, options) { var out = ""; for (var i = 0; i < count; i++) {