mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-27 18:44:58 +00:00
Major updates to text-slicer plugin
* In the interests of performance and expressiveness, switched to using a Sax parser instead of a DOM implementation. * Use extensible declarative rules to control the slicing process * Added new optional set of rules for slicing by heading, where the paragraphs underneath a heading are packed into the same tiddler as the heading * Added a modal dialogue for specifying parameters when slicing in the browser
This commit is contained in:
@@ -34,13 +34,22 @@ Command.prototype.execute = function() {
|
||||
wiki = this.commander.wiki,
|
||||
sourceTitle = this.params[0],
|
||||
destTitle = this.params[1],
|
||||
slicerRules = this.params[2],
|
||||
outputMode = this.params[3],
|
||||
slicer = new textSlicer.Slicer({
|
||||
sourceTiddlerTitle: sourceTitle,
|
||||
baseTiddlerTitle: destTitle,
|
||||
wiki: wiki
|
||||
slicerRules: slicerRules,
|
||||
outputMode: outputMode,
|
||||
wiki: wiki,
|
||||
callback: function(err,tiddlers) {
|
||||
if(err) {
|
||||
return self.callback(err);
|
||||
}
|
||||
wiki.addTiddlers(tiddlers);
|
||||
self.callback();
|
||||
}
|
||||
});
|
||||
wiki.addTiddlers(slicer.getTiddlers());
|
||||
$tw.utils.nextTick(this.callback);
|
||||
return null;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user