1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-17 15:24:50 +00:00

Remove some inaccurate documentation

There's a lot more weeding that needs to be done
This commit is contained in:
Jeremy Ruston 2012-10-25 22:56:13 +01:00
parent 5a58639131
commit f603854729
4 changed files with 1 additions and 51 deletions

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,6 @@ Here are a few features of TiddlyWiki that you can explore:
* If you're running on a touch browser like Mobile Safari on the iPad or iPhone: * If you're running on a touch browser like Mobile Safari on the iPad or iPhone:
** The zooming chooser appears by swiping into the left edge of the screen. (It's currently broken but you get the idea) ** The zooming chooser appears by swiping into the left edge of the screen. (It's currently broken but you get the idea)
** The zooming navigator appears by swiping in from the right edge of the screen. (It currently only works in the 'Classic' storyview) ** The zooming navigator appears by swiping in from the right edge of the screen. (It currently only works in the 'Classic' storyview)
* Play with the SubStories example to understand how the StoryMechanism works
* Browse the list of AllTiddlers or the ShadowTiddlers * Browse the list of AllTiddlers or the ShadowTiddlers
* Examine the example [[bitmap images|Motovun Jack.jpg]] and [[SVG images|Motovun Jack.svg]] * Examine the example [[bitmap images|Motovun Jack.jpg]] and [[SVG images|Motovun Jack.svg]]
* Explore the RoadMap of TiddlyWiki5's ongoing development * Explore the RoadMap of TiddlyWiki5's ongoing development

View File

@ -1,38 +1,3 @@
title: RenderingMechanism title: RenderingMechanism
tags: docs mechanism tags: docs mechanism
The `parseTree.compile(type)` method returns a renderer object that contains a JavaScript function that generates the new representation of the original parsed text.
The renderer is invoked as follows:
$$$.js
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.
!! Rerendering
When rendering to the HTML/SVG DOM in the browser, TiddlyWiki5 also allows a previous rendering to be selectively updated in response to changes in dependent tiddlers. At the moment, only the WikiTextRenderer supports rerendering.
The rerender method on the renderer is called as follows:
{{{
var node = document.getElementById("myNode");
var renderer = parseTree.compile("text/html");
myNode.innerHTML = renderer.render(tiddler,store);
// And then, later:
renderer.rerender(node,changes,tiddler,store,renderStep);
}}}
The parameters to `rerender()` are:
|!Name |!Description |
|node |A reference to the DOM node containing the rendering to be rerendered |
|changes |A hashmap of `{title: "created|modified|deleted"}` indicating which tiddlers have changed since the original rendering |
|tiddler |The tiddler providing the rendering context |
|store |The store to use for resolving references to other tiddlers |
|renderStep |See below |
Currently, the only macro that supports rerendering is the `<<story>>` macro; all other macros are rerendered by calling the ordinary `render()` method again. The reason that the `<<story>>` macro goes to the trouble of having a `rerender()` method is so that it can be carefully selective about not disturbing tiddlers in the DOM that aren't affected by the change. If there were, for instance, a video playing in one of the open tiddlers it would be reset to the beginning if the tiddler were rerendered.

View File

@ -1,14 +0,0 @@
title: SubStories
tags: samples
It is possible to have multiple instances of the `story` macro pointing to the same story tiddler, and it is even possible to nest them.
For example, this macro displays the same tiddlers as the main story but through the template used to display tags, which makes each tiddler appear as a tiny panel:
{{{
<<story story:"$:/StoryTiddlers" viewTemplate:[[$:/templates/TagTemplate]] storyview:classic >>
}}}
Select //Classic// or //Sideways// view in the navigation bar, and then try opening and closing other tiddlers and see how this second story animates when tiddlers are added and removed from the main story. It's also interesting to view the story tiddler alongside this one: [[$:/StoryTiddlers]].
<<story story:"$:/StoryTiddlers" viewTemplate:[[$:/templates/TagTemplate]] storyview:classic >>