mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
Lots of documentation updates
More to come...
This commit is contained in:
parent
4e0528e3dd
commit
f838d6e3c1
12
readme.md
12
readme.md
@ -24,15 +24,5 @@ renderer.rerender(node,changes,tiddler,store,renderStep);</pre><p>The parameters
|
||||
|renderStep |See below |</p><p>Currently, the only macro that supports rerendering is the <code><<story>></code> macro; all other macros are rerendered by calling the ordinary <code>render()</code> method again. The reason that the <code><<story>></code> macro goes to the trouble of having a <code>rerender()</code> 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.
|
||||
</p></div><h1>Plugin Mechanism</h1><div class='tw-tiddler-frame' data-tiddler-target='PluginMechanism' data-tiddler-template='PluginMechanism'><h1>Introduction</h1><p><a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='TiddlyWiki5'>TiddlyWiki5</a> is based on a 500 line boot kernel that runs on node.js or in the browser, and everything else is plugins.</p><p>The kernel boots just enough of the <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves' href='TiddlyWiki'>TiddlyWiki</a> environment to allow it to load tiddlers as plugins and execute them (a barebones tiddler class, a barebones wiki store class, some utilities etc.). Plugin modules are written like <code>node.js</code> modules; you can use <code>require()</code> to invoke sub components and to control load order.</p><p>There are several different types of plugins: parsers, serializers, deserializers, macros etc. It goes much further than you might expect. For example, individual tiddler fields are plugins, too: there's a plugin that knows how to handle the <code>tags</code> field, and another that knows how to handle the special behaviour of
|
||||
the <code>modified</code> and <code>created</code> fields.</p><p>Some plugins have further sub-plugins: the wikitext parser, for instance, accepts rules as individual plugins.</p><h1>Plugins and Modules</h1><p>In <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='TiddlyWiki5'>TiddlyWiki5</a>, a plugin is a bundle of related tiddlers that are distributed together as a single unit. Plugins can include tiddlers which are <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='JavaScript'>JavaScript</a> modules. </p><p>The file <code>core/boot.js</code> is a barebones <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves' href='TiddlyWiki'>TiddlyWiki</a> kernel that is just sufficient to load the core plugin modules and trigger a startup plugin module to load up the rest of the application.</p><p>The kernel includes:</p><ul><li> Eight short shared utility functions</li><li> Three methods implementing the plugin module mechanism</li><li> The <code>$tw.Tiddler</code> class (and three field definition plugins)</li><li> The <code>$tw.Wiki</code> class (and three tiddler deserialization methods)</li><li> Code for the browser to load tiddlers from the HTML DOM</li><li> Code for the server to load tiddlers from the file system</li></ul><p>Each module is an ordinary <code>node.js</code>-style module, using the <code>require()</code> function to access other modules and the <code>exports</code> global to return <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='JavaScript'>JavaScript</a> values. The boot kernel smooths over the differences between <code>node.js</code> and the browser, allowing the same plugin modules to execute in both environments.</p><p>In the browser, <code>core/boot.js</code> is packed into a template HTML file that contains the following elements in order:</p><ul><li> Ordinary and shadow tiddlers, packed as HTML <code><DIV></code> elements</li><li> <code>core/bootprefix.js</code>, containing a few lines to set up the plugin environment</li><li> Plugin <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='JavaScript'>JavaScript</a> modules, packed as HTML <code><SCRIPT></code> blocks</li><li> <code>core/boot.js</code>, containing the boot kernel</li></ul><p>On the server, <code>core/boot.js</code> is executed directly. It uses the <code>node.js</code> local file API to load plugins directly from the file system in the <code>core/modules</code> directory. The code loading is performed synchronously for brevity (and because the system is in any case inherently blocked until plugins are loaded).</p><p>The boot kernel sets up the <code>$tw</code> global variable that is used to store all the state data of the system.</p><h1>Core </h1><p>The 'core' is the boot kernel plus the set of plugin modules that it loads. It contains plugins of the following types:</p><ul><li> <code>tiddlerfield</code> - defines the characteristics of tiddler fields of a particular name</li><li> <code>tiddlerdeserializer</code> - methods to extract tiddlers from text representations or the DOM</li><li> <code>startup</code> - functions to be called by the kernel after booting</li><li> <code>global</code> - members of the <code>$tw</code> global</li><li> <code>config</code> - values to be merged over the <code>$tw.config</code> global</li><li> <code>utils</code> - general purpose utility functions residing in <code>$tw.utils</code></li><li> <code>tiddlermethod</code> - additional methods for the <code>$tw.Tiddler</code> class</li><li> <code>wikimethod</code> - additional methods for the <code>$tw.Wiki</code> class</li><li> <code>treeutils</code> - static utility methods for parser tree nodes </li><li> <code>treenode</code> - classes of parser tree nodes</li><li> <code>macro</code> - macro definitions</li><li> <code>editor</code> - interactive editors for different types of content</li><li> <code>parser</code> - parsers for different types of content</li><li> <code>wikitextrule</code> - individual rules for the wikitext parser</li><li> <code>command</code> - individual commands for the <code>$tw.Commander</code> class</li></ul><p><a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='TiddlyWiki5'>TiddlyWiki5</a> makes extensive use of <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='JavaScript'>JavaScript</a> inheritance:</p><ul><li> Tree nodes defined in <code>$:/core/treenodes/</code> all inherit from <code>$:/core/treenodes/node.js</code></li><li> Macros defined in <code>$:/core/macros/</code> all inherit from <code>$:/core/treenodes/macro.js</code></li></ul><p><code>tiddlywiki.plugin</code> files
|
||||
</p></div><h1>Planned <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='WikiText'>WikiText</a> Features</h1><div class='tw-tiddler-frame' data-tiddler-target='NewWikiTextFeatures' data-tiddler-template='NewWikiTextFeatures'><p>It is proposed to extend the existing <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves' href='TiddlyWiki'>TiddlyWiki</a> <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='WikiText'>WikiText</a> syntax with the following extensions</p><ol><li> Addition of <code>**bold**</code> character formatting</li><li> Addition of <code>`backtick for code`</code> character formatting</li><li> Addition of <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='WikiCreole-style'>WikiCreole-style</a> forced line break, e.g. <code>force\\linebreak</code></li><li> Addition of <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='WikiCreole-style'>WikiCreole-style</a> headings, e.g. <code>==Heading</code></li><li> Addition of <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='WikiCreole-style'>WikiCreole-style</a> headings in tables, e.g. <code>|=|=table|=header|</code></li><li> Addition of white-listed HTML and SVG tags intermixed with wikitext</li><li> Addition of <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='WikiCreole-style'>WikiCreole-style</a> pretty links, e.g. <code>[[description -> link]]</code></li><li> Addition of multiline macros, e.g.</li></ol><pre><<myMacro
|
||||
param1: Parameter value
|
||||
param2: value
|
||||
"unnamed parameter"
|
||||
param4: ((
|
||||
A multiline parameter that can go on for as long as it likes
|
||||
and contain linebreaks.
|
||||
))
|
||||
>></pre><ol><li> Addition of typed text blocks, e.g.</li></ol><pre> $$$.js
|
||||
return "This will have syntax highlighting applied"
|
||||
$$$</pre></div><p><em>This <code>readme</code> file was automatically generated by <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='TiddlyWiki5'>TiddlyWiki5</a></em>
|
||||
</p></div><h1>Planned <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves' href='WikiText'>WikiText</a> Features</h1><div class='tw-tiddler-frame tw-tiddler-missing' data-tiddler-target='NewWikiTextFeatures' data-tiddler-template='NewWikiTextFeatures'></div><p><em>This <code>readme</code> file was automatically generated by <a class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing' href='TiddlyWiki5'>TiddlyWiki5</a></em>
|
||||
</p>
|
142
tw5.com/tiddlers/Docs.tid
Normal file
142
tw5.com/tiddlers/Docs.tid
Normal file
@ -0,0 +1,142 @@
|
||||
title: Docs
|
||||
tags: docs
|
||||
|
||||
! Guides
|
||||
|
||||
* [[Getting started with TiddlyWiki in the browser]]
|
||||
* [[Getting started with TiddlyWiki under node.js]]
|
||||
* [[Getting involved in TiddlyWiki development]]
|
||||
|
||||
! Concepts
|
||||
|
||||
* [[Tiddler]]
|
||||
* [[Wiki]]
|
||||
* TiddlyWiki
|
||||
* WikiText
|
||||
* [[Filters]]
|
||||
* TiddlerFields
|
||||
* ShadowTiddlers
|
||||
* TiddlerModules
|
||||
|
||||
! Wiki Text Rules
|
||||
|
||||
* ClassBlockWikiText
|
||||
* CodeBlockWikiText
|
||||
* CodeRunWikiText
|
||||
* DashWikiText
|
||||
* EmphasisWikiText
|
||||
* EntityWikiText
|
||||
* ExternalLinkWikiText
|
||||
* HeadingWikiText
|
||||
* HtmlWikiText
|
||||
* ImageWikiText
|
||||
* ListWikiText
|
||||
* MacroWikiText
|
||||
* PrettyLinkWikiText
|
||||
* RuleWikiText
|
||||
* TypedBlockWikiText
|
||||
* WikiLinkWikiText
|
||||
|
||||
! Macros
|
||||
|
||||
* ViewMacro
|
||||
* EditMacro
|
||||
* StoryMacro
|
||||
* TiddlerMacro
|
||||
* ButtonMacro
|
||||
* CommentMacro
|
||||
* DownloadMacro
|
||||
* EchoMacro
|
||||
* ImageMacro
|
||||
* IncludeMacro
|
||||
* LinkMacro
|
||||
* ListMacro
|
||||
* VideoMacro
|
||||
* SliderMacro
|
||||
* ZoomerMacro
|
||||
* ChooserMacro
|
||||
|
||||
! Commands
|
||||
|
||||
* DumpCommand
|
||||
* LoadCommand
|
||||
* SaveTiddlerCommand
|
||||
* ServerCommand
|
||||
* VerboseCommand
|
||||
* VersionCommand
|
||||
* WikiTestCommand
|
||||
|
||||
! Internal Mechanisms
|
||||
|
||||
* BootMechanism
|
||||
* PluginMechanism
|
||||
* ParsingMechanism
|
||||
* RenderingMechanism
|
||||
* DependencyMechanism
|
||||
* RefreshMechanism
|
||||
* MacroMechanism
|
||||
* StoryMechanism
|
||||
* EditingMechanism
|
||||
* SavingMechanism
|
||||
* SyncMechanism
|
||||
* CommandMechanism
|
||||
* ConfigMechanism
|
||||
|
||||
! Data Model
|
||||
|
||||
* TiddlerObject
|
||||
* WikiObject
|
||||
|
||||
! Plugin Module Types
|
||||
|
||||
* CommandPlugins
|
||||
* ConfigPlugins
|
||||
* EditorPlugins
|
||||
* GlobalPlugins
|
||||
* LibraryPlugins
|
||||
* MacroPlugins
|
||||
* ModulePlugins
|
||||
* ParserPlugins
|
||||
* StartupPlugins
|
||||
* StoryViewPlugins
|
||||
* TiddlerDeserializerPlugins
|
||||
* TiddlerFieldPlugins
|
||||
* TiddlerMethodPlugins
|
||||
* TiddlerSerializerPlugins
|
||||
* TreeNodePlugins
|
||||
* TreeUtilsPlugins
|
||||
* UtilsPlugins
|
||||
* WikiMethodPlugins
|
||||
* WikiTextRulePlugins
|
||||
|
||||
! Tree Nodes
|
||||
|
||||
* TreeNode
|
||||
* ElementNode
|
||||
* EntityNode
|
||||
* MacroNode
|
||||
* RawNode
|
||||
* TextNode
|
||||
|
||||
! Other Parsers
|
||||
|
||||
* OldWikiTextParser
|
||||
* JsonParser
|
||||
* ImageParser
|
||||
* PlainTextParser
|
||||
* TiddlyTextParser
|
||||
* JavaScriptParser
|
||||
|
||||
! Deserializers
|
||||
|
||||
* RecipeFiles
|
||||
* TiddlerFiles
|
||||
|
||||
! Serializers
|
||||
|
||||
* TiddlyWikiFiles
|
||||
|
||||
! Miscellaneous
|
||||
|
||||
* [[Acknowledgements]]
|
||||
|
26
tw5.com/tiddlers/ImageMacro.tid
Normal file
26
tw5.com/tiddlers/ImageMacro.tid
Normal file
@ -0,0 +1,26 @@
|
||||
title: ImageMacro
|
||||
tags: docs macro
|
||||
|
||||
The ImageMacro displays an image with an optional tooltip.
|
||||
|
||||
! Parameters
|
||||
|
||||
! Examples
|
||||
|
||||
{{{
|
||||
<<tiddler [[Motovun Jack.jpg]]>>
|
||||
}}}
|
||||
|
||||
Appears as:
|
||||
|
||||
<<tiddler [[Motovun Jack.jpg]]>>
|
||||
|
||||
{{{
|
||||
<<image [[Motovun Jack.jpg]] text:"A kitten">>
|
||||
}}}
|
||||
|
||||
Appears as:
|
||||
|
||||
<<image [[Motovun Jack.jpg]] text:"A kitten">>
|
||||
|
||||
(Hover over the image to see the tooltip).
|
@ -1,60 +0,0 @@
|
||||
title: ImageTests
|
||||
tags: demo
|
||||
|
||||
This tiddler demonstrates different ways of displaying images
|
||||
|
||||
{{{
|
||||
<<tiddler [[Motovun Jack.jpg]]>>
|
||||
}}}
|
||||
|
||||
Appears as:
|
||||
|
||||
<<tiddler [[Motovun Jack.jpg]]>>
|
||||
|
||||
{{{
|
||||
<<image [[Motovun Jack.jpg]] text:"A kitten">>
|
||||
}}}
|
||||
|
||||
Appears as:
|
||||
|
||||
<<image [[Motovun Jack.jpg]] text:"A kitten">>
|
||||
|
||||
{{{
|
||||
[img[Motovun Jack.jpg]]
|
||||
}}}
|
||||
|
||||
Appears as:
|
||||
|
||||
[img[Motovun Jack.jpg]]
|
||||
|
||||
{{{
|
||||
[img[tooltip|Motovun Jack.jpg]]
|
||||
}}}
|
||||
|
||||
Appears as:
|
||||
|
||||
[img[tooltip|Motovun Jack.jpg]]
|
||||
|
||||
{{{
|
||||
[img[tooltip|Motovun Jack.jpg][http://google.com/]]
|
||||
}}}
|
||||
|
||||
Appears as:
|
||||
|
||||
[img[tooltip|Motovun Jack.jpg][http://google.com/]]
|
||||
|
||||
{{{
|
||||
<<tiddler [[Tiddler Fishes.svg]]>>
|
||||
}}}
|
||||
|
||||
Appears as:
|
||||
|
||||
<<tiddler [[Tiddler Fishes.svg]]>>
|
||||
|
||||
{{{
|
||||
[img[Tiddler Fishes.svg]]
|
||||
}}}
|
||||
|
||||
Appears as:
|
||||
|
||||
[img[Tiddler Fishes.svg]]
|
45
tw5.com/tiddlers/ImageWikiText.tid
Normal file
45
tw5.com/tiddlers/ImageWikiText.tid
Normal file
@ -0,0 +1,45 @@
|
||||
title: ImageWikiText
|
||||
tags: docs wikitextrule
|
||||
|
||||
The WikiText markup for images provides a shortcut for the ImageMacro, with an optional link and tooltip:
|
||||
|
||||
{{{
|
||||
[img[<tiddlertitle>]]
|
||||
[img[<url>]]
|
||||
[img[<tooltip>|<tiddlertitle>]]
|
||||
[img[<tooltip>|<tiddlertitle>][<link>]]
|
||||
}}}
|
||||
|
||||
! Examples
|
||||
|
||||
Simple usage:
|
||||
|
||||
{{{
|
||||
[img[Motovun Jack.jpg]]
|
||||
[img[Tiddler Fishes.svg]]
|
||||
}}}
|
||||
|
||||
Appears as:
|
||||
|
||||
[img[Motovun Jack.jpg]]
|
||||
[img[Tiddler Fishes.svg]]
|
||||
|
||||
With a tooltip:
|
||||
|
||||
{{{
|
||||
[img[tooltip|Motovun Jack.jpg]]
|
||||
}}}
|
||||
|
||||
Appears as:
|
||||
|
||||
[img[tooltip|Motovun Jack.jpg]]
|
||||
|
||||
With a tooltip and a link:
|
||||
|
||||
{{{
|
||||
[img[tooltip|Motovun Jack.jpg][http://google.com/]]
|
||||
}}}
|
||||
|
||||
Appears as:
|
||||
|
||||
[img[tooltip|Motovun Jack.jpg][http://google.com/]]
|
@ -8,12 +8,12 @@ You can modify this wiki, and then download a copy by clicking this button:
|
||||
|
||||
You can download a static copy of the tiddlers that are currently displayed in this wiki by clicking this button: <<download title:"$:/core/static.template.html" filename:"Story.html" label:"Static Wiki">>
|
||||
|
||||
{{alert alert-error{
|
||||
<div class="alert alert-error">
|
||||
Try out the prototype touch features:
|
||||
|
||||
* The zooming chooser appears by swiping into the left edge of the screen (or hover the mouse over the extreme left edge of the browser window)
|
||||
* The zooming navigator appears by swiping in from the right edge of the screen (not accessible by mouse)
|
||||
}}}
|
||||
</div>
|
||||
|
||||
Learning more about TiddlyWiki5:
|
||||
|
||||
@ -24,9 +24,8 @@ Some useful tiddlers for feature testing:
|
||||
|
||||
* HelloThere
|
||||
* TestingNewWikiText shows off the embryonic new wiki text engine
|
||||
* ImageTests showing different ways of embedding images
|
||||
* SampleData showing how JSON tiddlers are handled
|
||||
* SampleJavaScript and SampleJavaScriptWithError showing how JavaScript code is displayed
|
||||
* SampleJsonTiddler showing how JSON tiddlers are handled
|
||||
* SampleJavaScriptTiddler and SampleJavaScriptTiddlerWithError showing how JavaScript code is displayed
|
||||
* VideoTests showing how different online video formats can be embedded
|
||||
* SliderTests showing how sliders work
|
||||
* TypedBlockTests showing how embedded typed text blocks work
|
||||
|
@ -1,4 +1,3 @@
|
||||
title: JackSlider
|
||||
modifier: JackBeNimble
|
||||
|
||||
closed
|
||||
|
@ -1,31 +0,0 @@
|
||||
title: NewWikiTextFeatures
|
||||
modifier: JeremyRuston
|
||||
tags: feature
|
||||
|
||||
It is proposed to extend the existing TiddlyWiki WikiText syntax with the following extensions
|
||||
|
||||
# Addition of {{{**bold**}}} character formatting
|
||||
# Addition of {{{`backtick for code`}}} character formatting
|
||||
# Addition of WikiCreole-style forced line break, e.g. {{{force\\linebreak}}}
|
||||
# Addition of WikiCreole-style headings, e.g. {{{==Heading}}}
|
||||
# Addition of WikiCreole-style headings in tables, e.g. {{{|=|=table|=header|}}}
|
||||
# Addition of white-listed HTML and SVG tags intermixed with wikitext
|
||||
# Addition of WikiCreole-style pretty links, e.g. {{{[[description -> link]]}}}
|
||||
# Addition of multiline macros, e.g.
|
||||
{{{
|
||||
<<myMacro
|
||||
param1: Parameter value
|
||||
param2: value
|
||||
"unnamed parameter"
|
||||
param4: ((
|
||||
A multiline parameter that can go on for as long as it likes
|
||||
and contain linebreaks.
|
||||
))
|
||||
>>
|
||||
}}}
|
||||
# Addition of typed text blocks, e.g.
|
||||
{{{
|
||||
$$$.js
|
||||
return "This will have syntax highlighting applied"
|
||||
$$$
|
||||
}}}
|
@ -1,5 +1,5 @@
|
||||
title: PluginMechanism
|
||||
tags: internals
|
||||
tags: docs mechanism
|
||||
|
||||
!Introduction
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
title: SampleJavaScript
|
||||
title: SampleJavaScriptTiddler
|
||||
type: application/javascript
|
||||
tags: demo
|
||||
|
@ -1,4 +1,4 @@
|
||||
title: SampleJavaScriptWithError
|
||||
title: SampleJavaScriptTiddlerWithError
|
||||
type: application/javascript
|
||||
tags: demo
|
||||
|
@ -1,4 +1,4 @@
|
||||
title: SampleData
|
||||
title: SampleJsonTiddler
|
||||
type: application/json
|
||||
tags: demo
|
||||
|
@ -1,3 +1,4 @@
|
||||
title: ShadowTiddlers
|
||||
tags: docs concepts
|
||||
|
||||
<<list shadowed>>
|
||||
|
@ -1,5 +1,5 @@
|
||||
title: SliderTests
|
||||
tags: demo
|
||||
title: SliderMacro
|
||||
tags: docs macro
|
||||
|
||||
The status of this slider is stored in the tiddler JackSlider:
|
||||
|
@ -1,5 +1,10 @@
|
||||
title: TestingNewWikiText
|
||||
title: WikiText
|
||||
type: text/x-tiddlywiki
|
||||
tags: concepts
|
||||
|
||||
WikiText is a concise, expressive way of typing a wide range of text formatting and hypertext features. Operations like linking become part of the punctuation of your writing.
|
||||
|
||||
The key feature of wikitext is the ability to include one tiddler within another (usually referred to as //transclusion//). For example, one could have a tiddler called //Disclaimer// that contains the boilerplate of a legal disclaimer, and then include it within lots of different tiddlers with the macro call `<<tiddler Disclaimer>>`.
|
||||
|
||||
! This is a heading
|
||||
|
@ -5,6 +5,6 @@ type: application/json
|
||||
"tiddlers": [
|
||||
{"title": "HelloThere", "template": "$:/templates/ViewTemplate"},
|
||||
{"title": "Introduction", "template": "$:/templates/ViewTemplate"},
|
||||
{"title": "NewWikiTextFeatures", "template": "$:/templates/ViewTemplate"}
|
||||
{"title": "Docs", "template": "$:/templates/ViewTemplate"}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user