1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-12 10:20:26 +00:00

Coding style updates

@welford there were some minor tweaks with whitespace, coalescing
consecutive var statements, camelcase rather than underscores in
variable names.
This commit is contained in:
Jermolene 2015-02-20 22:17:28 +00:00
parent 7eeb286551
commit bba4794c0a

View File

@ -46,20 +46,20 @@ Command.prototype.execute = function() {
} }
$tw.utils.each(tiddlers,function(title) { $tw.utils.each(tiddlers,function(title) {
var parser = wiki.parseTiddler(template), var parser = wiki.parseTiddler(template),
widgetNode = wiki.makeWidget(parser,{variables: {currentTiddler: title}}); widgetNode = wiki.makeWidget(parser,{variables: {currentTiddler: title}}),
var container = $tw.fakeDocument.createElement("div"); container = $tw.fakeDocument.createElement("div");
widgetNode.render(container,null); widgetNode.render(container,null);
var text = type === "text/html" ? container.innerHTML : container.textContent; var text = type === "text/html" ? container.innerHTML : container.textContent,
var export_path = null; exportPath = null;
if($tw.utils.hop($tw.macros,"tv-get-export-path")) { if($tw.utils.hop($tw.macros,"tv-get-export-path")) {
var macroPath = $tw.macros["tv-get-export-path"].run.apply(self,[title]); var macroPath = $tw.macros["tv-get-export-path"].run.apply(self,[title]);
if(macroPath) { if(macroPath) {
export_path = path.resolve( outputPath, macroPath + extension); exportPath = path.resolve(outputPath,macroPath + extension);
} }
} }
var final_path = export_path || path.resolve(pathname,encodeURIComponent(title) + extension); var finalPath = exportPath || path.resolve(pathname,encodeURIComponent(title) + extension);
$tw.utils.createFileDirectories(final_path); $tw.utils.createFileDirectories(finalPath);
fs.writeFileSync(final_path,text,"utf8"); fs.writeFileSync(finalPath,text,"utf8");
}); });
return null; return null;
}; };