From 04e9376eca13b62ea155d04a74293be0f9caa50f Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Tue, 24 Jan 2012 18:11:38 +0000 Subject: [PATCH] Refactored the story macro to invoke the tiddler macro to display tiddlers --- js/macros/story.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/js/macros/story.js b/js/macros/story.js index 15d096f8a..c29e129c2 100644 --- a/js/macros/story.js +++ b/js/macros/story.js @@ -13,8 +13,8 @@ exports.macro = { name: "story", types: ["text/html","text/plain"], params: { - story: {byName: "default", type: "text", optional: false}, - template: {byName: true, type: "text", optional: true} + story: {byName: "default", type: "tiddler", optional: false}, + template: {byName: true, type: "tiddler", optional: true} }, handler: function(type,tiddler,store,params) { var tiddlers = store.getTiddlerText(params.story).split("\n"), @@ -23,13 +23,21 @@ exports.macro = { for(t=0; t"); if(params.template) { - output.push(store.renderTiddler(type,params.template,title)); + output.push(store.renderMacro("tiddler", + type, + store.getTiddler(title), + { + target: params.template + })); } else { - output.push(store.renderTiddler(type,title)); + output.push(store.renderMacro("tiddler", + type, + store.getTiddler(title), + { + target: title + })); } - output.push(""); } } return output.join("\n");