mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Docs update
This commit is contained in:
parent
6d24cedbcc
commit
bab43fe6c2
@ -3,4 +3,4 @@ tags: navigation
|
||||
|
||||
Current tiddlers:
|
||||
|
||||
<_list type="all" />
|
||||
<$list type="all" />
|
||||
|
@ -1,4 +1,4 @@
|
||||
title: ContextTiddler
|
||||
tags: docs concepts
|
||||
|
||||
The ContextTiddler is the current tiddler during WikiText processing. It allows you to write a widget like `<_view field="title" format="link"/>` in TiddlerTemplates without explicitly specifying the tiddler that it applies to.
|
||||
The ContextTiddler is the current tiddler during WikiText processing. It allows you to write a widget like `<$view field="title" format="link"/>` in TiddlerTemplates without explicitly specifying the tiddler that it applies to.
|
||||
|
@ -7,4 +7,4 @@ Thus, even an apparently empty TiddlyWiki actually contains dozens of tiddlers t
|
||||
|
||||
The current shadow tiddlers are:
|
||||
|
||||
<_list type="shadows" />
|
||||
<$list type="shadows" />
|
||||
|
@ -200,10 +200,10 @@ This is my nice and simple block of text. HelloThere
|
||||
|
||||
! Widgets
|
||||
|
||||
Widgets provide rich functionality within WikiText. For example, the `<_video>` widget can be used to embed videos from YouTube, Vimeo or the Internet Archive:
|
||||
Widgets provide rich functionality within WikiText. For example, the `<$video>` widget can be used to embed videos from YouTube, Vimeo or the Internet Archive:
|
||||
|
||||
```
|
||||
<_video src="32001208" type="vimeo" />
|
||||
<$video src="32001208" type="vimeo" />
|
||||
```
|
||||
|
||||
For full details of the available widgets, see the [[Docs]].
|
||||
|
@ -1,51 +1,4 @@
|
||||
title: ParsingMechanism
|
||||
tags: docs mechanism
|
||||
|
||||
TiddlyWiki parses the content of tiddlers to build an internal tree representation that is used for several purposes:
|
||||
|
||||
* Rendering a tiddler to other formats (e.g. converting wikitext to HTML)
|
||||
* Detecting outgoing links from a tiddler, and from them...
|
||||
* ...computing incoming links to a tiddler
|
||||
* Detecting tiddlers that are orphans with no incoming links
|
||||
* Detecting tiddlers that are referred to but missing
|
||||
|
||||
The parse tree is built when needed, and then cached by the WikiStore until the tiddler changes.
|
||||
|
||||
TiddlyWiki5 uses multiple parsers:
|
||||
|
||||
* Wikitext ({{{text/vnd.tiddlywiki}}}) in `js/WikiTextParser.js`
|
||||
* JavaScript ({{{text/javascript}}}) in `js/JavaScriptParser.js`
|
||||
* Images ({{{image/png}}} and {{{image/jpg}}}) in `js/ImageParser.js`
|
||||
* JSON ({{{application/json}}}) in `js/JSONParser.js`
|
||||
Additional parsers are planned:
|
||||
* CSS ({{{text/css}}})
|
||||
* Recipe ({{{text/vnd.tiddlywiki-recipe}}})
|
||||
|
||||
One global instance of each parser is instantiated in `js/App.js` and registered with the main WikiStore object.
|
||||
|
||||
The parsers are all used the same way:
|
||||
|
||||
$$$.js
|
||||
var parseTree = parser.parse(type,text) // Parses the text and returns a parse tree object
|
||||
$$$
|
||||
|
||||
The parse tree object exposes the following fields:
|
||||
|
||||
$$$.js
|
||||
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 (either `text/html` or `text/plain`)
|
||||
var dependencies = parseTree.dependencies; // Gets the dependencies of the parse tree (see below)
|
||||
$$$
|
||||
|
||||
The dependencies are returned as an object like this:
|
||||
|
||||
{{{
|
||||
{
|
||||
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.
|
||||
|
||||
The `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.
|
||||
|
@ -3,8 +3,8 @@ tags: docs widget
|
||||
|
||||
Here is a collection of embedded videos. Try opening and closing tiddlers while the videos are playing; they should not be affected.
|
||||
|
||||
<_video src="32001208" type="vimeo" />
|
||||
<$video src="32001208" type="vimeo" />
|
||||
|
||||
<_video src="wvWHnK2FiCk" type="youtube" />
|
||||
<$video src="wvWHnK2FiCk" type="youtube" />
|
||||
|
||||
<_video src="santa_claus_conquers_the_martians_ipod" type="archiveorg" />
|
||||
<$video src="santa_claus_conquers_the_martians_ipod" type="archiveorg" />
|
||||
|
Loading…
Reference in New Issue
Block a user