mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-23 07:26:54 +00:00
Add support for parameter substitutions to the savetiddler command
This commit is contained in:
parent
175d7c67fd
commit
1db72ea931
@ -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;
|
||||
|
@ -4,5 +4,7 @@ tags: docs command
|
||||
Save an individual tiddler as a specified ContentType, defaults to `text/html`
|
||||
|
||||
{{{
|
||||
--savetiddler <title> <filename> [<type>]
|
||||
--savetiddler <title> <filename> [<type>] [<withparam> <withparam>...]
|
||||
}}}
|
||||
|
||||
The optional `<withparams>` are substituted for `$1`, `$2` etc before parsing.
|
||||
|
Loading…
Reference in New Issue
Block a user