diff --git a/bld.cmd b/bld.cmd index 9d803d2b0..0b988676a 100644 --- a/bld.cmd +++ b/bld.cmd @@ -94,6 +94,14 @@ node .\tiddlywiki.js ^ --rendertiddler $:/core/save/all markdowndemo.html text/plain ^ || exit 1 +rem classicparserdemo.html: wiki to demo classicparser plugin + +node .\tiddlywiki.js ^ + .\editions\classicparserdemo ^ + --verbose ^ + --output %TW5_BUILD_OUTPUT% ^ + --rendertiddler $:/core/save/all classicparserdemo.html text/plain ^ + || exit 1 rem highlightdemo.html: wiki to demo highlight plugin diff --git a/bld.sh b/bld.sh index ad707acd9..50ad509b9 100755 --- a/bld.sh +++ b/bld.sh @@ -95,6 +95,15 @@ node ./tiddlywiki.js \ --rendertiddler $:/core/save/all markdowndemo.html text/plain \ || exit 1 +# classicparserdemo.html: wiki to demo classicparser plugin + +node ./tiddlywiki.js \ + ./editions/classicparserdemo \ + --verbose \ + --output $TW5_BUILD_OUTPUT \ + --rendertiddler $:/core/save/all classicparserdemo.html text/plain \ + || exit 1 + # highlightdemo.html: wiki to demo highlight plugin node ./tiddlywiki.js \ diff --git a/editions/classicparserdemo/tiddlers/$__DefaultTiddlers.tid b/editions/classicparserdemo/tiddlers/$__DefaultTiddlers.tid new file mode 100644 index 000000000..2ea5805fa --- /dev/null +++ b/editions/classicparserdemo/tiddlers/$__DefaultTiddlers.tid @@ -0,0 +1,12 @@ +created: 20140417191319973 +modified: 20140901082708004 +title: $:/DefaultTiddlers +type: text/vnd.tiddlywiki + +[[Classic Parser Plugin Demo]] +[[Classic Slider Demo]] +[[ClassicTabsDemo]] +[[Classic Transclusion]] +[[text/x-tiddlywiki typeblock]] +[[Markup]] +[[Developers Notes]] \ No newline at end of file diff --git a/editions/classicparserdemo/tiddlers/$__ShowEditPreview.tid b/editions/classicparserdemo/tiddlers/$__ShowEditPreview.tid new file mode 100644 index 000000000..89d259d5f --- /dev/null +++ b/editions/classicparserdemo/tiddlers/$__ShowEditPreview.tid @@ -0,0 +1,6 @@ +created: 20140416191641926 +modified: 20140417181106838 +title: $:/ShowEditPreview +type: text/vnd.tiddlywiki + +yes \ No newline at end of file diff --git a/editions/classicparserdemo/tiddlers/$__SiteSubtitle.tid b/editions/classicparserdemo/tiddlers/$__SiteSubtitle.tid new file mode 100644 index 000000000..d73c44a5b --- /dev/null +++ b/editions/classicparserdemo/tiddlers/$__SiteSubtitle.tid @@ -0,0 +1,5 @@ +created: 20140417192155748 +modified: 20140417192155748 +title: $:/SiteSubtitle +type: text/vnd.tiddlywiki + diff --git a/editions/classicparserdemo/tiddlers/$__SiteTitle.tid b/editions/classicparserdemo/tiddlers/$__SiteTitle.tid new file mode 100644 index 000000000..a84e0d4bc --- /dev/null +++ b/editions/classicparserdemo/tiddlers/$__SiteTitle.tid @@ -0,0 +1,6 @@ +created: 20140417192135107 +modified: 20140417192152339 +title: $:/SiteTitle +type: text/vnd.tiddlywiki + +Classic Parser Demo \ No newline at end of file diff --git a/editions/classicparserdemo/tiddlers/Basic Formatting.tid b/editions/classicparserdemo/tiddlers/Basic Formatting.tid new file mode 100644 index 000000000..061b1053f --- /dev/null +++ b/editions/classicparserdemo/tiddlers/Basic Formatting.tid @@ -0,0 +1,24 @@ +created: 20121217004633000 +creator: keithb +modified: 20140415164633773 +modifier: andrewstern +tags: Formatting +title: Basic Formatting +type: text/x-tiddlywiki + + +!Summary +//''Emphasizing''// @@text@@ __is easy__! +!Markup +| !Style | !Markup |h +|bold|{{{''bold''}}} -- two single-quotes| +|//italics//|{{{//italics//}}}| +|bold italics|{{{''//bold italics//''}}}| +|__underline__|{{{__underline__}}}| +|--strikethrough--|{{{--Strikethrough--}}}| +|super^^script^^|{{{super^^script^^}}}| +|sub~~script~~|{{{sub~~script~~}}}| +|@@Highlight@@|{{{@@Highlight@@}}}| +|{{{plain text}}}|{{{PlainText No ''Formatting''}}}| +|/%this text will be invisible%/hidden text|{{{/%this text will be invisible%/}}}| +|foo -- bar|{{{use two dashes -- between two words to create an Em dash}}}| diff --git a/editions/classicparserdemo/tiddlers/Blockquotes.tid b/editions/classicparserdemo/tiddlers/Blockquotes.tid new file mode 100644 index 000000000..5b46336bb --- /dev/null +++ b/editions/classicparserdemo/tiddlers/Blockquotes.tid @@ -0,0 +1,43 @@ +created: 20110215174227000 +creator: pmario +modified: 20140415164659711 +modifier: andrewstern +tags: Formatting +title: Blockquotes +type: text/x-tiddlywiki + +!Summary +Use quotations to cite other sources or simply indent content. +!!Blockquotes +Text can be displayed as quotations using three less-than signs: +{{{ +<<< +Steve Jobs: "computers are like a bicycle for our minds" +<<< +}}} +<<< +Steve Jobs: "computers are like a bicycle for our minds" +<<< +!Nested Blockquotes +Quotes can be displayed with multi-levels: +{{{ +> blockquote, level 1 +>> blockquote, level 2 +>>> blockquote, level 3 +}}} +> blockquote, level 1 +>> blockquote, level 2 +>>> blockquote, level 3 +!!Mixed Blockquotes +{{{ +<<< +Steve Jobs: "computers are like a bicycle for our minds" +> blockquote, level 1 +Some more text. +<<< +}}} +<<< +Steve Jobs: "computers are like a bicycle for our minds" +> blockquote, level 1 +Some more text. +<<< diff --git a/editions/classicparserdemo/tiddlers/CSS Formatting.tid b/editions/classicparserdemo/tiddlers/CSS Formatting.tid new file mode 100644 index 000000000..3415a1651 --- /dev/null +++ b/editions/classicparserdemo/tiddlers/CSS Formatting.tid @@ -0,0 +1,39 @@ +created: 20130211145116000 +creator: tobibeer +modified: 20140415164516606 +modifier: andrewstern +tags: Formatting +title: CSS Formatting +type: text/x-tiddlywiki + + +!Summary +You can directly apply CSS rules inline or use custom classes. +!Markup +!!!Inline Styles +Enclose text using two double @ signs and let the first two follow by your CSS rules. +{{{ +@@color:#4bbbbb;Some random text@@ +}}} +''Displays as:'' +@@color:red;Some random text@@ + +!!!CSS Classes +CSS classes can be applied to text blocks. + +To wrap your text inline in a HTML {{{}}} element use... +{{{ +before » {{customClassName{inline content}}} « after +}}} +''Displays as:'' +before » {{customClassName{inline content}}} « after + +To wrap your text as a block level element -- a HTML {{{
}}} -- use line-breaks... +
+before » {{customClassName{
+box content
+}}} « after
+
''Displays as:'' +before » {{customClassName{ +box content +}}} « after diff --git a/editions/classicparserdemo/tiddlers/Classic Parser Plugin Demo.tid b/editions/classicparserdemo/tiddlers/Classic Parser Plugin Demo.tid new file mode 100644 index 000000000..a35f261d4 --- /dev/null +++ b/editions/classicparserdemo/tiddlers/Classic Parser Plugin Demo.tid @@ -0,0 +1,14 @@ +created: 20140416201128370 +modified: 20140901082657977 +title: Classic Parser Plugin Demo +type: text/x-tiddlywiki + +This is a demo of the Tiddlywiki Classic parser for Tiddlywiki5 (the tw2parser plugin). +Below is a [[Test card|Markup]] from [[http://tiddlywiki.org]] showing examples of all Classic markup. + +Tiddlers that are given the type 'text/x-tiddlywiki' will be interpreted as containing Classic Tiddlywiki markup. In addition Classic Tiddlywiki markup can be embedded in a tiddlywiki5 tiddler by the use of a type block - see [[text/x-tiddlywiki typeblock]] below. +!!Support for Classic macros +At present there is limited support for Classic macros. See below for examples of the [[slider|Classic Slider Demo]], [[tabs|ClassicTabsDemo]] and [[tiddler|Classic Transclusion]] macros. +!!Status +See here for <> +!!See also [[Developers Notes]] diff --git a/editions/classicparserdemo/tiddlers/Classic Slider Demo.tid b/editions/classicparserdemo/tiddlers/Classic Slider Demo.tid new file mode 100644 index 000000000..6010f9744 --- /dev/null +++ b/editions/classicparserdemo/tiddlers/Classic Slider Demo.tid @@ -0,0 +1,13 @@ +created: 20140831105412236 +modified: 20140901072049425 +title: Classic Slider Demo +type: text/x-tiddlywiki + +!!Demo text: +{{{ +<> +}}} +!!Demo results: + +<> + \ No newline at end of file diff --git a/editions/classicparserdemo/tiddlers/Classic Transclusion.tid b/editions/classicparserdemo/tiddlers/Classic Transclusion.tid new file mode 100644 index 000000000..139d8dc1f --- /dev/null +++ b/editions/classicparserdemo/tiddlers/Classic Transclusion.tid @@ -0,0 +1,12 @@ +created: 20140831105630157 +modified: 20140901082725277 +title: Classic Transclusion +type: text/x-tiddlywiki + +!!Demo text: +{{{ +<> +}}} +!!Demo results: + +<> diff --git a/editions/classicparserdemo/tiddlers/ClassicTabsDemo.tid b/editions/classicparserdemo/tiddlers/ClassicTabsDemo.tid new file mode 100644 index 000000000..76e1dbbdc --- /dev/null +++ b/editions/classicparserdemo/tiddlers/ClassicTabsDemo.tid @@ -0,0 +1,39 @@ +created: 20140603181004793 +modified: 20140901071957024 +title: ClassicTabsDemo +type: text/x-tiddlywiki + +!!Demo text: +{{{ +<> + +/% +!Do1 +first section: this is a hidden section below +!Do2 +another hidden section of this tiddler +!end +|~slice| a hidden slice of this tiddler| +!end +%/ +}}} +!!Demo results: +<> + +/% +!Do1 +first section: this is a hidden section below +!Do2 +another hidden section of this tiddler +!end +|~slice| a hidden slice of this tiddler| +!end +%/ diff --git a/editions/classicparserdemo/tiddlers/Code.tid b/editions/classicparserdemo/tiddlers/Code.tid new file mode 100644 index 000000000..809a6d67e --- /dev/null +++ b/editions/classicparserdemo/tiddlers/Code.tid @@ -0,0 +1,30 @@ +created: 20130211142734000 +creator: tobibeer +modified: 20140901061201603 +modifier: andrewstern +tags: Formatting +title: Code +type: text/x-tiddlywiki + +!Summary +You can render text monospaced text, e.g. using the font //Courier//, while preserving line breaks and not applying WikiText formating or turning WikiWords into links. +!!"""Monospaced Text Block""" +
+{{{
+Some plain text including WikiLinks
+}}}
+
''Displays as:'' a HTML
 element
+{{{
+Some plain text including WikiLinks
+}}}
+<<<
+''Note:'' Code blocks are displayed using a white-space 'as-is', fixed-width font without no word-wrapping -- displayed in a box.
+<<<
+!!"""Monospaced Inline Text"""
+Alternatively, you can also display monospaced text __inline__ by wrapping the text in three braces {{{...}}}:
+
{{{inline //code//}}}
''Displays as:'' a HTML element +{{{inline //code//}}} +<<< +''Note:'' Inline code uses a white-space 'collapsed', word-wrapped, fixed-width font. + + diff --git a/editions/classicparserdemo/tiddlers/Comment Formatting.tid b/editions/classicparserdemo/tiddlers/Comment Formatting.tid new file mode 100644 index 000000000..2b8a4dedf --- /dev/null +++ b/editions/classicparserdemo/tiddlers/Comment Formatting.tid @@ -0,0 +1,29 @@ +created: 20130213001758000 +creator: tobibeer +modified: 20140901061006864 +modifier: andrewstern +tags: Formatting +title: Comment Formatting +type: text/x-tiddlywiki + +!Summary +Occasionally you want to add notes to your tiddler markup yet don't want it displayed when the tiddler is rendered. To achieve this, wrap the text using {{{/% hidden %/}}}. +!Example +{{{ +text before .../% +!HIDDEN SECTION +This is content of a hidden section. +!END%/ text after +}}} +''Display as:'' +<<< +text before /% +!HIDDEN SECTION +This is content of a hidden section. +!END%/... text after +<<< +!Also see... +;[[Suppressing Formatting]] +:» when you just don't want that text to be TiddlyWiki markup +:» when you want to prevent WikiWords +:» when you copy & paste from other sources diff --git a/editions/classicparserdemo/tiddlers/Developers Notes.tid b/editions/classicparserdemo/tiddlers/Developers Notes.tid new file mode 100644 index 000000000..73d3015af --- /dev/null +++ b/editions/classicparserdemo/tiddlers/Developers Notes.tid @@ -0,0 +1,26 @@ +created: 20140831112438405 +modified: 20140901080739956 +title: Developers Notes +type: text/x-tiddlywiki + +The includes handling of namespace conflicts between Classic and Tw5 macros. + +One of the goals of the Tw2parser plugin is to hide the Classic macros from tiddlers of types other than text/x-tiddlywiki. This is achieved by having the parser prepend the macro definitions to the 'local' parse tree (see around line 60 wikitextparser.js), making them only visible in text/x-tiddlywiki tiddlers and typed-blocks. At present all text based Classic macros are in the same file. + +As all global Tw5 macros are visible in all tiddlers (including text/x-tiddlywiki tiddlers), there is a name-space conflict between Classic and tw5 macros. For macros that are defined using tiddlytext (ie /define() /end blocks) the local defined Classic definition will override the global Tw5 macros (which is what we want). + +For cases where simple overriding is not sufficient, the tw2parser plugin also has a 'macro name adapter' module (macroadapter.js) to move the Classic macros names to a new names - +(in wikitextrules.js around line 490) + +{{{tw2on5-name=macroadapter.namedapter[tw2name];}}} + +This is invisible to the user. + +An example is the {{{tabs()}}} macro which is mapped to {{{__system_tabs()}}} +so the user still types {{{tabs()}}} but this is mapped to {{{__system_tabs()}}} in the parser which is what appears in the file macrodefs.tids + +There is also the facility to manipulate the parameters via {{{params=macroadapter.paramadaptername}}} +This is used in the 'tabs' macro where there is a variable number of parameters that must be mapped into fixed number of tw5 macro parameters. + +The implementation of the tabs macro is rather sophisticated, the parameters are put into maps from tab-tiddername to tab-property (properties are cookies, prompts and labels) implemented as jsons. + diff --git a/editions/classicparserdemo/tiddlers/HTML Entities.tid b/editions/classicparserdemo/tiddlers/HTML Entities.tid new file mode 100644 index 000000000..ca59eb338 --- /dev/null +++ b/editions/classicparserdemo/tiddlers/HTML Entities.tid @@ -0,0 +1,50 @@ +created: 20130204165019000 +creator: tobibeer +modified: 20140415164150742 +modifier: andrewstern +tags: Formatting +title: HTML Entities +type: text/x-tiddlywiki + +!Summary +Use HTML entities to enter characters that can't easily be typed on an ordinary keyboard. They take the form of an ampersand ({{{&}}}), an identifying string, and a terminating semi-colon ({{{;}}}), e.g. {{{&}}}. +!Markup +{{{ +The value of Tiddlers™ cannot even be expressed in £, € or $. +}}} +''Displays as:'' +The value of Tiddlers™ cannot even be expressed in £, € or $. + +!"""Entity References""" +Comprehensive lists of html entities can be found at... +* [[w3schools.com|http://www.w3schools.com/tags/ref_entities.asp]] +* [[htmlhelp.com|http://www.htmlhelp.com/reference/html40/entities]] + +!"""Examples Of Common And Eseful Entities""" +|>|>|>|>|>|>| !HTML Entities | +| &nbsp; |   | no-break space |    | &apos; | ' | single quote, apostrophe | +| &ndash; | – | en dash |~| &quot; | " | quotation mark | +| &mdash; | — | em dash |~| &prime; | ′ | prime; minutes; feet | +| &hellip; | … | horizontal ellipsis |~| &Prime; | ″ | double prime; seconds; inches | +| &copy; | © | Copyright symbol |~| &lsquo; | ‘ | left single quote | +| &reg; | ® | Registered symbol |~| &rsquo; | ’ | right single quote | +| &trade; | ™ | Trademark symbol |~| &ldquo; | “ | left double quote | +| &dagger; | † | dagger |~| &rdquo; | ” | right double quote | +| &Dagger; | ‡ | double dagger |~| &laquo; | « | left angle quote | +| &para; | ¶ | paragraph sign |~| &raquo; | » | right angle quote | +| &sect; | § | section sign |~| &times; | × | multiplication symbol | +| &uarr; | ↑ | up arrow |~| &darr; | ↓ | down arrow | +| &larr; | ← | left arrow |~| &rarr; | → | right arrow | +| &lArr; | ⇐ | double left arrow |~| &rArr; | ⇒ | double right arrow | +| &harr; | ↔ | left right arrow |~| &hArr; | ⇔ | double left right arrow | +!"""Accented Characters""" +The table below shows how accented characters can be built up by subsituting the underscore (_) into the corresponding character: +|>|>|>|>|>|>|>|>|>|>|>|>|>|>|>|>|>| !Accented Characters | +| grave accent | &_grave; | À | à | È | è | Ì | ì | Ò | ò | Ù | ù |   |   |   |   |   |   | +| acute accent | &_acute; | Á | á | É | é | Í | í | Ó | ó | Ú | ú |   |   | Ý | ý |   |   | +| circumflex accent | &_circ; | Â | â | Ê | ê | Î | î | Ô | ô | Û | û |   |   |   |   |   |   | +| umlaut mark | &_uml; | Ä | ä | Ë | ë | Ï | ï | Ö | ö | Ü | ü |   |   | Ÿ | ÿ |   |   | +| tilde | &_tilde; | Ã | ã |   |   |   |   | Õ | õ |   |   | Ñ | ñ |   |   |   |   | +| ring | &_ring; | Å | å |   |   |   |   |   |   |   |   |   |   |   |   |   |   | +| slash | &_slash; |   |   |   |   |   |   | Ø | ø |   |   |   |   |   |   |   |   | +| cedilla | &_cedil; |   |   |   |   |   |   |   |   |   |   |   |   |   |   | Ç | ç | diff --git a/editions/classicparserdemo/tiddlers/HTML Formatting.tid b/editions/classicparserdemo/tiddlers/HTML Formatting.tid new file mode 100644 index 000000000..916ca267f --- /dev/null +++ b/editions/classicparserdemo/tiddlers/HTML Formatting.tid @@ -0,0 +1,29 @@ +created: 20130212225913000 +creator: tobibeer +modified: 20140415163847476 +modifier: andrewstern +tags: Formatting +title: HTML Formatting +type: text/x-tiddlywiki + +!Summary +TiddlyWiki provides support for rendering pure HTML markup. To do this, simply wrap your HTML code in {{{your html markup goes here}}}. This way you are able to use embed code using iFrames often suggested by popular media sites like ~YouTube. +!!"""Embedded HTML""" +{{{ + +any
+valid xhtml + +}}} +any
valid xhtml +!!"""Embedded iFrame""" +{{{ + +