mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-10 12:33:00 +00:00
Enhance rendertiddler command with support for additional variable
Passing an arbitrary variable allows us to e.g. reuse the export filters as shown in the example
This commit is contained in:
@@ -34,12 +34,17 @@ Command.prototype.execute = function() {
|
||||
filename = path.resolve(this.commander.outputPath,this.params[1]),
|
||||
type = this.params[2] || "text/html",
|
||||
template = this.params[3],
|
||||
name = this.params[4],
|
||||
value = this.params[5],
|
||||
variables = {};
|
||||
$tw.utils.createFileDirectories(filename);
|
||||
if(template) {
|
||||
variables.currentTiddler = title;
|
||||
title = template;
|
||||
}
|
||||
if(name && value) {
|
||||
variables[name] = value;
|
||||
}
|
||||
fs.writeFile(filename,this.commander.wiki.renderTiddler(type,title,{variables: variables}),"utf8",function(err) {
|
||||
self.callback(err);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user