1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-30 23:23:02 +00:00

Add support for parameter substitutions to the savetiddler command

This commit is contained in:
Jeremy Ruston
2012-08-25 12:07:15 +01:00
parent 175d7c67fd
commit 1db72ea931
2 changed files with 11 additions and 3 deletions

View File

@@ -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<this.params.length; t++) {
options["with"] = options["with"] || [];
options["with"][t-2] = this.params[t];
}
fs.writeFile(filename,this.commander.wiki.renderTiddler(type,title,options),"utf8",function(err) {
self.callback(err);
});
return null;