From ae7d1771fd2e8b03df3d75bf005411a18997036c Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 21 Jan 2013 17:27:07 +0000 Subject: [PATCH] Fixed TW2 edition Now we can build TW2 files with just a few whitespace differences from the old Ruby tools --- editions/tw2/plugins/stripcomments.js | 27 ---------- .../tw2/plugins/stripcomments/plugin.bundle | 7 +++ .../plugins/stripcomments/stripcomments.js | 54 +++++++++++++++++++ .../wiki/html-div-tiddler-remove-prefix.tid | 9 ++++ .../plain-text-tiddler-strip-comments.tid | 3 ++ .../tw2/wiki/tiddlywiki2.template.html.tid | 45 ++++++++-------- 6 files changed, 96 insertions(+), 49 deletions(-) delete mode 100644 editions/tw2/plugins/stripcomments.js create mode 100644 editions/tw2/plugins/stripcomments/plugin.bundle create mode 100644 editions/tw2/plugins/stripcomments/stripcomments.js create mode 100644 editions/tw2/wiki/html-div-tiddler-remove-prefix.tid create mode 100644 editions/tw2/wiki/plain-text-tiddler-strip-comments.tid diff --git a/editions/tw2/plugins/stripcomments.js b/editions/tw2/plugins/stripcomments.js deleted file mode 100644 index f8a445e60..000000000 --- a/editions/tw2/plugins/stripcomments.js +++ /dev/null @@ -1,27 +0,0 @@ -/*\ -title: $:/plugins/stripcomments.js -type: application/javascript -module-type: tiddlerserializer - -Special serializer for cooking old versions of TiddlyWiki. It removes JavaScript comments formatted as `//#` - -\*/ -(function(){ - -/*jslint node: true, browser: true */ -/*global $tw: false */ -"use strict"; - -exports["text/plain-strip-comments"] = function(tiddler) { - var lines =tiddler.fields.text.split("\n"), - out = []; - for(var line=0; line=5.0.0" +} diff --git a/editions/tw2/plugins/stripcomments/stripcomments.js b/editions/tw2/plugins/stripcomments/stripcomments.js new file mode 100644 index 000000000..579a5ea33 --- /dev/null +++ b/editions/tw2/plugins/stripcomments/stripcomments.js @@ -0,0 +1,54 @@ +/*\ +title: $:/plugins/tiddlywiki2/stripcomments/stripcomments.js +type: application/javascript +module-type: fieldviewer + +Special viewer for cooking old versions of TiddlyWiki. It removes JavaScript comments formatted as `//#` + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +var stripComments = function(text) { + var lines = text.split("\n"), + out = []; + for(var line=0; line``> +
`<$view field="text" format="htmlencoded" />`
+` diff --git a/editions/tw2/wiki/plain-text-tiddler-strip-comments.tid b/editions/tw2/wiki/plain-text-tiddler-strip-comments.tid new file mode 100644 index 000000000..3370d436d --- /dev/null +++ b/editions/tw2/wiki/plain-text-tiddler-strip-comments.tid @@ -0,0 +1,3 @@ +title: $:/core/templates/plain-text-tiddler-strip-comments + +<$view field="text" format="stripcomments" /> \ No newline at end of file diff --git a/editions/tw2/wiki/tiddlywiki2.template.html.tid b/editions/tw2/wiki/tiddlywiki2.template.html.tid index 71eabc5e1..950c97ccd 100644 --- a/editions/tw2/wiki/tiddlywiki2.template.html.tid +++ b/editions/tw2/wiki/tiddlywiki2.template.html.tid @@ -1,40 +1,41 @@ title: $:/core/templates/tiddlywiki2.template.html -type: text/vnd.tiddlywiki-html +\rules only filteredtranscludeinline transcludeinline + > +{{{ [prefix[{copyright}]] ||$:/core/templates/plain-text-tiddler}}} " /> -<> +{{{ [prefix[{prehead}]] ||$:/core/templates/plain-text-tiddler}}} -<<serialize "[prefix[{title}]]" text/plain>> +{{{ [prefix[{title}]] ||$:/core/templates/plain-text-tiddler}}} -<> +{{{ [prefix[{posthead}]] ||$:/core/templates/plain-text-tiddler}}} -<> +{{{ [prefix[{prebody}]] ||$:/core/templates/plain-text-tiddler}}}
@@ -46,39 +47,39 @@ Welcome to TiddlyWiki created by Jeremy Ruston; Copyright © 2004-2007 Jerem
-<> +{{{ [prefix[{shadow}]] +[sort-case-sensitive[title]] ||$:/core/templates/html-div-tiddler-remove-prefix}}}
-<> -<> -<> +{{{ [prefix[{tiddler}]] +[sort-case-sensitive[title]] ||$:/core/templates/html-div-tiddler-remove-prefix}}} +{{{ [prefix[{plugin}]] ||$:/core/templates/plain-text-tiddler}}} +{{{ [prefix[{posttiddlers}]] ||$:/core/templates/plain-text-tiddler}}}
-<> +{{{ [prefix[{postbody}]] ||$:/core/templates/plain-text-tiddler}}} -<> +{{{ [prefix[{jsext}]] ||$:/core/templates/plain-text-tiddler-strip-comments}}} -<> +{{{ [prefix[{postscript}]] ||$:/core/templates/plain-text-tiddler}}}