diff --git a/bld.cmd b/bld.cmd index 3511cd541..18a809c5b 100644 --- a/bld.cmd +++ b/bld.cmd @@ -31,7 +31,7 @@ node .\tiddlywiki.js ^ --verbose ^ --rendertiddler ReadMe .\readme.md text/html ^ --rendertiddler ContributingTemplate .\contributing.md text/html ^ - --rendertiddler $:/core/templates/tiddlywiki5.template.html %TW5_BUILD_OUTPUT%\index.html text/plain ^ + --rendertiddler $:/core/save/all %TW5_BUILD_OUTPUT%\index.html text/plain ^ --rendertiddler $:/core/templates/static.template.html %TW5_BUILD_OUTPUT%\static.html text/plain ^ --rendertiddler $:/core/templates/static.template.css %TW5_BUILD_OUTPUT%\static\static.css text/plain ^ --rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html %TW5_BUILD_OUTPUT%\static text/plain ^ @@ -43,7 +43,7 @@ node .\tiddlywiki.js ^ .\editions\tw5.com ^ --verbose ^ --password password ^ - --rendertiddler $:/core/templates/tiddlywiki5.template.html %TW5_BUILD_OUTPUT%\encrypted.html text/plain ^ + --rendertiddler $:/core/save/all %TW5_BUILD_OUTPUT%\encrypted.html text/plain ^ || exit 1 rem Third, empty.html: empty wiki for reuse @@ -51,7 +51,7 @@ rem Third, empty.html: empty wiki for reuse node .\tiddlywiki.js ^ .\editions\empty ^ --verbose ^ - --rendertiddler $:/core/templates/tiddlywiki5.template.html %TW5_BUILD_OUTPUT%\empty.html text/plain ^ + --rendertiddler $:/core/save/all %TW5_BUILD_OUTPUT%\empty.html text/plain ^ || exit 1 rem Fourth, tahoelafs.html: empty wiki with plugin for Tahoe-LAFS @@ -59,7 +59,7 @@ rem Fourth, tahoelafs.html: empty wiki with plugin for Tahoe-LAFS node .\tiddlywiki.js ^ .\editions\tahoelafs ^ --verbose ^ - --rendertiddler $:/core/templates/tiddlywiki5.template.html %TW5_BUILD_OUTPUT%\tahoelafs.html text/plain ^ + --rendertiddler $:/core/save/all %TW5_BUILD_OUTPUT%\tahoelafs.html text/plain ^ || exit 1 rem Fifth, d3demo.html: wiki to demo d3 plugin @@ -67,7 +67,7 @@ rem Fifth, d3demo.html: wiki to demo d3 plugin node .\tiddlywiki.js ^ .\editions\d3demo ^ --verbose ^ - --rendertiddler $:/core/templates/tiddlywiki5.template.html %TW5_BUILD_OUTPUT%\d3demo.html text/plain ^ + --rendertiddler $:/core/save/all %TW5_BUILD_OUTPUT%\d3demo.html text/plain ^ || exit 1 rem Sixth, codemirrordemo.html: wiki to demo codemirror plugin @@ -75,7 +75,7 @@ rem Sixth, codemirrordemo.html: wiki to demo codemirror plugin node .\tiddlywiki.js ^ .\editions\codemirrordemo ^ --verbose ^ - --rendertiddler $:/core/templates/tiddlywiki5.template.html %TW5_BUILD_OUTPUT%\codemirrordemo.html text/plain ^ + --rendertiddler $:/core/save/all %TW5_BUILD_OUTPUT%\codemirrordemo.html text/plain ^ || exit 1 rem Seventh, codemirrordemo.html: wiki to demo codemirror plugin @@ -83,7 +83,7 @@ rem Seventh, codemirrordemo.html: wiki to demo codemirror plugin node .\tiddlywiki.js ^ .\editions\markdowndemo ^ --verbose ^ - --rendertiddler $:/core/templates/tiddlywiki5.template.html %TW5_BUILD_OUTPUT%\markdowndemo.html text/plain ^ + --rendertiddler $:/core/save/all %TW5_BUILD_OUTPUT%\markdowndemo.html text/plain ^ || exit 1 diff --git a/bld.sh b/bld.sh index 5e6555dd5..9eabe0a09 100755 --- a/bld.sh +++ b/bld.sh @@ -37,7 +37,7 @@ node ./tiddlywiki.js \ --verbose \ --rendertiddler ReadMe ./readme.md text/html \ --rendertiddler ContributingTemplate ./contributing.md text/html \ - --rendertiddler $:/core/templates/tiddlywiki5.template.html $TW5_BUILD_OUTPUT/index.html text/plain \ + --rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/index.html text/plain \ --rendertiddler $:/core/templates/static.template.html $TW5_BUILD_OUTPUT/static.html text/plain \ --rendertiddler $:/core/templates/static.template.css $TW5_BUILD_OUTPUT/static/static.css text/plain \ --rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html $TW5_BUILD_OUTPUT/static text/plain \ @@ -49,7 +49,7 @@ node ./tiddlywiki.js \ ./editions/tw5.com \ --verbose \ --password password \ - --rendertiddler $:/core/templates/tiddlywiki5.template.html $TW5_BUILD_OUTPUT/encrypted.html text/plain \ + --rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/encrypted.html text/plain \ || exit 1 # Third, empty.html: empty wiki for reuse @@ -57,7 +57,7 @@ node ./tiddlywiki.js \ node ./tiddlywiki.js \ ./editions/empty \ --verbose \ - --rendertiddler $:/core/templates/tiddlywiki5.template.html $TW5_BUILD_OUTPUT/empty.html text/plain \ + --rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/empty.html text/plain \ || exit 1 # Fourth, tahoelafs.html: empty wiki with plugin for Tahoe-LAFS @@ -65,7 +65,7 @@ node ./tiddlywiki.js \ node ./tiddlywiki.js \ ./editions/tahoelafs \ --verbose \ - --rendertiddler $:/core/templates/tiddlywiki5.template.html $TW5_BUILD_OUTPUT/tahoelafs.html text/plain \ + --rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/tahoelafs.html text/plain \ || exit 1 # Fifth, d3demo.html: wiki to demo d3 plugin @@ -73,7 +73,7 @@ node ./tiddlywiki.js \ node ./tiddlywiki.js \ ./editions/d3demo \ --verbose \ - --rendertiddler $:/core/templates/tiddlywiki5.template.html $TW5_BUILD_OUTPUT/d3demo.html text/plain \ + --rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/d3demo.html text/plain \ || exit 1 # Sixth, codemirrordemo.html: wiki to demo codemirror plugin @@ -81,7 +81,7 @@ node ./tiddlywiki.js \ node ./tiddlywiki.js \ ./editions/codemirrordemo \ --verbose \ - --rendertiddler $:/core/templates/tiddlywiki5.template.html $TW5_BUILD_OUTPUT/codemirrordemo.html text/plain \ + --rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/codemirrordemo.html text/plain \ || exit 1 # Seventh, codemirrordemo.html: wiki to demo codemirror plugin @@ -89,7 +89,7 @@ node ./tiddlywiki.js \ node ./tiddlywiki.js \ ./editions/markdowndemo \ --verbose \ - --rendertiddler $:/core/templates/tiddlywiki5.template.html $TW5_BUILD_OUTPUT/markdowndemo.html text/plain \ + --rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/markdowndemo.html text/plain \ || exit 1 # Eighth, run the test edition to run the Node.js tests and to generate test.html for tests in the browser diff --git a/core/modules/commands/server.js b/core/modules/commands/server.js index 5764d8f08..116c47adf 100644 --- a/core/modules/commands/server.js +++ b/core/modules/commands/server.js @@ -221,7 +221,7 @@ var Command = function(params,commander,callback) { Command.prototype.execute = function() { var port = this.params[0] || "8080", - rootTiddler = this.params[1] || "$:/core/templates/tiddlywiki5.template.html", + rootTiddler = this.params[1] || "$:/core/save/all", renderType = this.params[2] || "text/plain", serveType = this.params[3] || "text/html", username = this.params[4] || "ANONYMOUS"; diff --git a/core/modules/wiki.js b/core/modules/wiki.js index 3cad3b409..b5f4ed9b3 100755 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -871,7 +871,7 @@ Save the wiki contents. Options are: */ exports.saveWiki = function(options) { options = options || {}; - var template = options.template || "$:/core/templates/tiddlywiki5.template.html", + var template = options.template || "$:/core/save/all", downloadType = options.downloadType || "text/plain"; var text = this.renderTiddler(downloadType,template); this.callSaver("save",text,function(err) { diff --git a/core/templates/save-all.tid b/core/templates/save-all.tid new file mode 100644 index 000000000..27fa88f70 --- /dev/null +++ b/core/templates/save-all.tid @@ -0,0 +1,6 @@ +title: $:/core/save/all + +\define saveTiddlerFilter() +[is[tiddler]] -[type[text/css]] -[type[application/javascript]has[module-type]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] +\end +{{$:/core/templates/tiddlywiki5.html}} diff --git a/core/templates/save-empty.tid b/core/templates/save-empty.tid new file mode 100644 index 000000000..23c863efb --- /dev/null +++ b/core/templates/save-empty.tid @@ -0,0 +1,6 @@ +title: $:/core/save/empty + +\define saveTiddlerFilter() +[is[system]] -[type[text/css]] -[type[application/javascript]has[module-type]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] +\end +{{$:/core/templates/tiddlywiki5.html}} diff --git a/core/templates/static.area.tid b/core/templates/static.area.tid new file mode 100644 index 000000000..a7fbdf7bc --- /dev/null +++ b/core/templates/static.area.tid @@ -0,0 +1,8 @@ +title: $:/core/templates/static.area + +<$reveal type="nomatch" state="$:/isEncrypted" text="yes"> +{{$:/core/templates/static.content||$:/core/templates/html-tiddler}} +$reveal> +<$reveal type="match" state="$:/isEncrypted" text="yes"> +This file contains an encrypted ~TiddlyWiki. Enable ~JavaScript and enter the decryption password when prompted. +$reveal> diff --git a/core/templates/static.content.tid b/core/templates/static.content.tid index 1936df866..5be6cf953 100644 --- a/core/templates/static.content.tid +++ b/core/templates/static.content.tid @@ -1,12 +1,11 @@ title: $:/core/templates/static.content type: text/vnd.tiddlywiki -<$reveal type="nomatch" state="$:/isEncrypted" text="yes"> -<$list filter="[!is[system]sort[title]]" > -<$view field="title" format="text">$view> +This [[TiddlyWiki|http://tiddlywiki.com]] contains the following tiddlers: + +