From 1db72ea9313dd6bb3ba036e54db6220d112df599 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sat, 25 Aug 2012 12:07:15 +0100 Subject: [PATCH] Add support for parameter substitutions to the savetiddler command --- core/modules/commands/savetiddler.js | 10 ++++++++-- tw5.com/tiddlers/commands/SaveTiddlerCommand.tid | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/core/modules/commands/savetiddler.js b/core/modules/commands/savetiddler.js index d58b71b4a..1167868c7 100644 --- a/core/modules/commands/savetiddler.js +++ b/core/modules/commands/savetiddler.js @@ -32,8 +32,14 @@ Command.prototype.execute = function() { path = require("path"), title = this.params[0], filename = this.params[1], - type = this.params[2] || "text/html"; - fs.writeFile(filename,this.commander.wiki.renderTiddler(type,title),"utf8",function(err) { + type = this.params[2] || "text/html", + options = {}, + t; + for(var t=3; t [] +--savetiddler <filename> [<type>] [<withparam> <withparam>...] }}} + +The optional `<withparams>` are substituted for `$1`, `$2` etc before parsing.