diff --git a/readme.md b/readme.md
index 5b6e1cb21..0b816253b 100644
--- a/readme.md
+++ b/readme.md
@@ -5,11 +5,17 @@ node tiddlywiki.js --verbose --load mywiki.html --savetiddler ReadMe ./readme.ht
--wikitest
looks for *.tid
files in the specified folder. It then wikifies the tiddlers to both "text/plain" and "text/html" format and checks the results against the content of the *.html
and *.txt
files in the same directory.node.js
, two batch files are provided:run.sh
boots the kernel and loads the core modules and then outputs the $tw
global for inspectionbld.sh
builds the new TiddlyWiki 5 HTML file (placed in the tmp/tw5/
directory by default)text/x-tiddlywiki
wikitext into text/html
or text/plain
but the engine is used throughout the system for other transformations, such as converting images for display in HTML, sanitising fragments of JavaScript, and processing CSS.<<tiddler Disclaimer>>
. This simple feature brings great power in terms of encapsulating and reusing content, and evolving a clean, usable implementation architecture to support it efficiently is a key objective of the TiddlyWiki5 design.<<story story:MyStoryTiddler>>The story macro looks for a list of tiddler titles in the tiddler
MyStoryTiddler
, and displays them in sequence. The subtle part is that subsequently, if MyStoryTiddler
changes, the <<story>>
macro is selectively re-rendered. So, to navigate to a new tiddler, code merely needs to add the name of the tiddler and a line break to the top of MyStoryTiddler
:var storyTiddler = store.getTiddler("MyStoryTiddler"); store.addTiddler(new Tiddler(storyTiddler,{text: navigateTo + "\n" + storyTiddler.text})); -The mechanisms that allow all of this to work are fairly intricate. The sections below progressively build the key architectural concepts of TiddlyWiki5 in a way that should provide a good basis for exploring the code directly.
title
field, but useful tiddlers also have a text
field, and some or all of the standard fields modified
, modifier
, created
, creator
, tags
and type
.tags
field is a string array, and that the modified
and created
fields are JavaScript Date
objects. All other fields are strings.type
field identifies the representation of the tiddler text with a MIME type.nexttick
handler (if it hasn't already done so). The nexttick
handler looks back at all the tiddler changes, and dispatches any matching event handlers. text/x-tiddlywiki
) in js/WikiTextParser.js
text/javascript
) in js/JavaScriptParser.js
image/png
and image/jpg
) in js/ImageParser.js
application/json
) in js/JSONParser.js
text/css
)text/x-tiddlywiki-recipe
)js/App.js
and registered with the main WikiStore object.{ +The mechanisms that allow all of this to work are fairly intricate. The sections below progressively build the key architectural concepts of TiddlyWiki5 in a way that should provide a good basis for exploring the code directly.
title
field, but useful tiddlers also have a text
field, and some or all of the standard fields modified
, modifier
, created
, creator
, tags
and type
.tags
field is a string array, and that the modified
and created
fields are JavaScript Date
objects. All other fields are strings.type
field identifies the representation of the tiddler text with a MIME type.nexttick
handler (if it hasn't already done so). The nexttick
handler looks back at all the tiddler changes, and dispatches any matching event handlers. text/x-tiddlywiki
) in js/WikiTextParser.js
text/javascript
) in js/JavaScriptParser.js
image/png
and image/jpg
) in js/ImageParser.js
application/json
) in js/JSONParser.js
text/css
)text/x-tiddlywiki-recipe
)js/App.js
and registered with the main WikiStore object.var parseTree = parser.parse(type,text) // Parses the text and returns a parse tree objectThe parse tree object exposes the following fields:
+
var renderer = parseTree.compile(type); // Compiles the parse tree into a renderer for the specified MIME type +console.log(parseTree.toString(type)); // Returns a readable string representation of the parse tree (eitherThe dependencies are returned as an object like this:text/html
ortext/plain
) +var dependencies = parseTree.dependencies; // Gets the dependencies of the parse tree (see below)
+
{ tiddlers: {"tiddlertitle1": true, "tiddlertitle2": false}, dependentAll: false } -The
tiddlers
field is a hashmap of the title of each tiddler that is linked or included in the current one. The value is true
if the tiddler is a 'fat' dependency (ie the text is included in some way) or false
if the tiddler is a skinny
dependency.dependentAll
field is used to indicate that the tiddler contains a macro that scans the entire pool of tiddlers (for example the <<list>>
macro), and is potentially dependent on any of them. The effect is that the tiddler should be rerendered whenever any other tiddler changes.parseTree.compile(type)
method returns a renderer object that contains a JavaScript function that generates the new representation of the original parsed text.tiddler
parameter to the render
method identifies the tiddler that is acting as the context for this rendering — for example, it provides the fields displayed by the <<view>>
macro. The store
parameter is used to resolve any references to other tiddlers.var node = document.getElementById("myNode"); +The
tiddlers
field is a hashmap of the title of each tiddler that is linked or included in the current one. The value is true
if the tiddler is a 'fat' dependency (ie the text is included in some way) or false
if the tiddler is a skinny
dependency.dependentAll
field is used to indicate that the tiddler contains a macro that scans the entire pool of tiddlers (for example the <<list>>
macro), and is potentially dependent on any of them. The effect is that the tiddler should be rerendered whenever any other tiddler changes.parseTree.compile(type)
method returns a renderer object that contains a JavaScript function that generates the new representation of the original parsed text.var renderer = parseTree.compile("text/html"); +var html = renderer.render(tiddler,store); +The
tiddler
parameter to the render
method identifies the tiddler that is acting as the context for this rendering — for example, it provides the fields displayed by the <<view>>
macro. The store
parameter is used to resolve any references to other tiddlers.var node = document.getElementById("myNode"); var renderer = parseTree.compile("text/html"); myNode.innerHTML = renderer.render(tiddler,store); // And then, later: