1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-29 15:30:47 +00:00

Added a 'dump tiddler' command

This commit is contained in:
Jeremy Ruston 2012-05-05 11:18:24 +01:00
parent fa0e16eef5
commit a094dc4b29

View File

@ -37,6 +37,17 @@ Command.prototype.execute = function() {
Command.prototype.subcommands = {};
Command.prototype.subcommands.tiddler = function() {
if(this.params.length < 2) {
return "Too few parameters for dump tiddler command";
}
var tiddler = this.commander.wiki.getTiddler(this.params[1]);
this.output.write("Tiddler '" + this.params[1] + "' contains these fields:\n");
for(var t in tiddler.fields) {
this.output.write(" " + t + ": " + tiddler.getFieldString(t) + "\n");
}
return null; // No error
};
Command.prototype.subcommands.tiddlers = function() {
var tiddlers = this.commander.wiki.sortTiddlers();