Docs update

This commit is contained in:
Jeremy Ruston committed 2012-02-10 11:12:20 +00:00
1 parent 7fdd8985ef
commit 63da7ec980
5 files changed
+66 -16

No files matched your search

+6 -6
View File
@@ -1,12 +1,12 @@
<div data-tw-render-tiddler='ReadMe'><h1>Welcome to <span data-tw-macro='link' data-tw-render-step='1'><a href='TiddlyWiki5' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki5</a></span></h1><div data-tw-macro='tiddler' data-tw-render-step='2'><div data-tw-render-tiddler='HelloThere'><div data-tw-macro='view' data-tw-render-step='1'><a href='HelloThere' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>HelloThere</a></div><br><br>Welcome to <span data-tw-macro='link' data-tw-render-step='2'><a href='TiddlyWiki5' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki5</a></span>, a reboot of the venerable, reusable non-linear personal web notebook first released in 2004. It is a complete interactive wiki that can run from a single HTML file or as a powerful <code>node.js</code> application.<br><br><span data-tw-macro='link' data-tw-render-step='3'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> is based on the idea of making information more useful by modelling it in the smallest meaningful semantic units, referred to as &quot;tiddlers&quot;. Structure comes from links, tags, and stories (sequences of tiddlers). Tiddlers use a wikitext notation that concisely represents a wide range of text formatting and hypertext features.<br><br><span data-tw-macro='link' data-tw-render-step='4'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> has earned an enduring role as a tool that people <span data-tw-macro='link' data-tw-render-step='5'><a href='Raves' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>love using</a></span> for its rich, interactive interface to <span data-tw-macro='link' data-tw-render-step='6'><a href='TiddlyWikiConcepts' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>manipulate complex data</a></span> with structure that doesn't easily fit into conventional tools like spreadsheets or wordprocessors. Because people can use it without needing any complicated server infrastructure, and because it is <span data-tw-macro='link' data-tw-render-step='7'><a href='OpenSourceLicense' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>open source</a></span>, it has bought unprecedented freedom to people to keep their precious information under their own control. <span data-tw-macro='link' data-tw-render-step='8'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> was originally created by <span data-tw-macro='link' data-tw-render-step='9'><a href='JeremyRuston' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JeremyRuston</a></span> and is now a thriving <span data-tw-macro='link' data-tw-render-step='10'><a href='OpenSourceLicense' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>open source</a></span> project with a busy <span data-tw-macro='link' data-tw-render-step='11'><a href='Community' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>Community</a></span> of independent developers.<br><br><span data-tw-macro='link' data-tw-render-step='12'><a href='TiddlyWiki5' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki5</a></span> is currently in early beta, which is to say that it is useful but incomplete. You can get involved in the development on <span data-tw-macro='link' data-tw-render-step='13'><a href='GitHub' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>GitHub</a></span> and the discussions on Google Groups:<br><br><span data-tw-macro='link' data-tw-render-step='14'><a href='https://github.com/Jermolene/TiddlyWiki5' class='tw-tiddlylink tw-tiddlylink-external'>https://github.com/Jermolene/TiddlyWiki5</a></span><br><span data-tw-macro='link' data-tw-render-step='15'><a href='http://groups.google.com/group/TiddlyWikiDev' class='tw-tiddlylink tw-tiddlylink-external'>http://groups.google.com/group/TiddlyWikiDev</a></span><br></div></div><br><h1>Usage</h1><div data-tw-macro='tiddler' data-tw-render-step='3'><div data-tw-render-tiddler='CommandLineInterface'><span data-tw-macro='link' data-tw-render-step='1'><a href='TiddlyWiki5' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki5</a></span> can be used on the command line to perform an extensive set of operations based on <span data-tw-macro='link' data-tw-render-step='2'><a href='RecipeFiles' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>RecipeFiles</a></span>, <span data-tw-macro='link' data-tw-render-step='3'><a href='TiddlerFiles' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlerFiles</a></span> and <span data-tw-macro='link' data-tw-render-step='4'><a href='TiddlyWikiFiles' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWikiFiles</a></span>.<br><br>UsaLine truncated
<div data-tw-render-tiddler='ReadMe'><h1>Welcome to <span data-tw-macro='link' data-tw-render-step='1'><a href='TiddlyWiki5' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki5</a></span></h1><div data-tw-macro='tiddler' data-tw-render-step='2'><div data-tw-render-tiddler='HelloThere'>Welcome to <span data-tw-macro='link' data-tw-render-step='1'><a href='TiddlyWiki5' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki5</a></span>, a reboot of <span data-tw-macro='link' data-tw-render-step='2'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlyWiki</a></span>, the venerable, reusable non-linear personal web notebook first released in 2004. It is a complete interactive wiki that can run from a single HTML file or as a powerful <span data-tw-macro='link' data-tw-render-step='3'><a href='What%20is%20node.js%3F' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>node.js application</a></span>.<br><br>Some useful tiddlers for feature testing:<br><ul><li> <span data-tw-macro='link' data-tw-render-step='4'><a href='ImageTests' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>ImageTests</a></span> showing different ways of embedding images</li><li> <span data-tw-macro='link' data-tw-render-step='5'><a href='SampleData' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>SampleData</a></span> showing how JSON tiddlers are handled</li><li> <span data-tw-macro='link' data-tw-render-step='6'><a href='VideoTests' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>VideoTests</a></span> showing how different online video formats can be embedded</li></ul><br>Technical documentation includes:<br><ul><li> <span data-tw-macro='link' data-tw-render-step='7'><a href='Testing' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>Testing</a></span> regimen</li><li> Details of the <span data-tw-macro='link' data-tw-render-step='8'><a href='CommandLineInterface' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>CommandLineInterface</a></span></li><li> Overview of <span data-tw-macro='link' data-tw-render-step='9'><a href='TiddlyWikiArchitecture' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlyWikiArchitecture</a></span></li><ul><li> <span data-tw-macro='link' data-tw-render-step='10'><a href='MacroInternals' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>MacroInternals</a></span></li></ul><li> Information about <span data-tw-macro='link' data-tw-render-step='11'><a href='TiddlerFiles' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlerFiles</a></span> and <span data-tw-macro='link' data-tw-render-step='12'><a href='RecipeFiles' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>RecipeFiles</a></span></li><li> <span data-tw-macro='link' data-tw-render-step='13'><a href='NewWikiTextFeatures' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>NewWikiTextFeatures</a></span></li></ul><br><span data-tw-macro='link' data-tw-render-step='14'><a href='TiddlyWiki5' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki5</a></span> is currently in early beta, which is to say that it is useful but incomplete. You can get involved in the development on <span data-tw-macro='link' data-tw-render-step='15'><a href='GitHub' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>GitHub</a></span> and the discussions on Google Groups:<br><br><span data-tw-macro='link' data-tw-render-step='16'><a href='https://github.com/Jermolene/TiddlyWiki5' class='tw-tiddlylink tw-tiddlylink-external'>https://github.com/Jermolene/TiddlyWiki5</a></span><br><span data-tw-macro='link' data-tw-render-step='17'><a href='http://groups.google.com/group/TiddlyWikiDev' class='tw-tiddlylink tw-tiddlylink-external'>http://groups.google.com/group/TiddlyWikiDev</a></span><br><br><blockquote>Bug: this link doesn't work:<br><div data-tw-macro='view' data-tw-render-step='18'><a href='HelloThere' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>HelloThere</a></div><br></blockquote></div></div><br><h1>Usage</h1><div data-tw-macro='tiddler' data-tw-render-step='3'><div data-tw-render-tiddler='CommandLineInterface'><span data-tw-macro='link' data-tw-render-step='1'><a href='TiddlyWiki5' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki5</a></span> can be used on the command line to perform an extensive set of operations based on <span data-tw-macro='link' data-tw-render-step='2'><a href='RecipeFiles' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>RecipeFiles</a></span>, <span data-tw-macro='link' data-tw-render-step='3'><a href='TiddlerFiles' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlerFiles</a></span> and <span data-tw-macro='link' data-tw-render-step='4'Line truncated
node tiddlywiki.js &lt;options&gt;
</code><br>The command line options are processed sequentially from left to right. Processing pauses during long operations, like loading a <span data-tw-macro='link' data-tw-render-step='5'><a href='RecipeFiles' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>recipe file</a></span> and all the subrecipes and <span data-tw-macro='link' data-tw-render-step='6'><a href='TiddlerFiles' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>tiddlers</a></span> that it references. The following options are available:<br><table class='twtable'><tbody><tr class='evenRow'><td align='left'><code>--recipe &lt;filepath&gt;</code></td><td align='left'>Loads a specfied <code>.recipe</code> file</td></tr><tr class='oddRow'><td align='left'><code>--load &lt;filepath&gt;</code></td><td align='left'>Load additional tiddlers from 2.x.x <span data-tw-macro='link' data-tw-render-step='7'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> files (<code>.html</code>), <code>.tiddler</code>, <code>.tid</code>, <code>.json</code> or other files</td></tr><tr class='evenRow'><td align='left'><code>--savewiki &lt;dirpath&gt;</code></td><td align='left'>Saves all the loaded tiddlers as a single file <span data-tw-macro='link' data-tw-render-step='8'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> called <code>index.html</code> and an RSS feed called <code>index.xml</code> in a new directory of the specified name</td></tr><tr class='oddRow'><td align='left'><code>--savetiddler &lt;title&gt; &lt;filename&gt; [&lt;type&gt;]</code></td><td align='left'>Save an individual tiddler as a specified MIME type, defaults to <code>text/html</code></td></tr><tr class='evenRow'><td align='left'><code>--savetiddlers &lt;outdir&gt;</code></td><td align='left'>Saves all the loaded tiddlers as <code>.tid</code> files in the specified directory</td></tr><tr class='oddRow'><td align='left'><code>--servewiki &lt;port&gt;</code></td><td align='left'>Serve the cooked <span data-tw-macro='link' data-tw-render-step='9'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> over HTTP at <code>/</code></td></tr><tr class='evenRow'><td align='left'><code>--servetiddlers &lt;port&gt;</code></td><td align='left'>Serve individual tiddlers over HTTP at <code>/tiddlertitle</code></td></tr><tr class='oddRow'><td align='left'><code>--wikitest &lt;dir&gt;</code></td><td align='left'>Run wikification tests against the tiddlers in the given directory</td></tr><tr class='evenRow'><td align='left'><code>--dumpstore</code></td><td align='left'>Dump the <span data-tw-macro='link' data-tw-render-step='10'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> store in JSON format</td></tr><tr class='oddRow'><td align='left'><code>--dumprecipe</code></td><td align='left'>Dump the current recipe in JSON format</td></tr><tr class='evenRow'><td align='left'><code>--verbose</code></td><td align='left'>verbose output, useful for debugging</td></tr></tbody></table><h2> Examples</h2>This example loads the tiddlers from a <span data-tw-macro='link' data-tw-render-step='11'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> HTML file and makes them available over HTTP:<br><code>
</code><br>The command line options are processed sequentially from left to right. Processing pauses during long operations, like loading a <span data-tw-macro='link' data-tw-render-step='5'><a href='RecipeFiles' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>recipe file</a></span> and all the subrecipes and <span data-tw-macro='link' data-tw-render-step='6'><a href='TiddlerFiles' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>tiddlers</a></span> that it references, and then resumes with the next command line option in sequence. The following options are available:<br><table class='twtable'><tbody><tr class='evenRow'><td align='left'><code>--recipe &lt;filepath&gt;</code></td><td align='left'>Loads a specfied <code>.recipe</code> file</td></tr><tr class='oddRow'><td align='left'><code>--load &lt;filepath&gt;</code></td><td align='left'>Load additional tiddlers from 2.x.x <span data-tw-macro='link' data-tw-render-step='7'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlyWiki</a></span> files (<code>.html</code>), <code>.tiddler</code>, <code>.tid</code>, <code>.json</code> or other files</td></tr><tr class='evenRow'><td align='left'><code>--savewiki &lt;dirpath&gt;</code></td><td align='left'>Saves all the loaded tiddlers as a single file <span data-tw-macro='link' data-tw-render-step='8'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlyWiki</a></span> called <code>index.html</code> and an RSS feed called <code>index.xml</code> in a new directory of the specified name</td></tr><tr class='oddRow'><td align='left'><code>--savetiddler &lt;title&gt; &lt;filename&gt; [&lt;type&gt;]</code></td><td align='left'>Save an individual tiddler as a specified MIME type, defaults to <code>text/html</code></td></tr><tr class='evenRow'><td align='left'><code>--savetiddlers &lt;outdir&gt;</code></td><td align='left'>Saves all the loaded tiddlers as <code>.tid</code> files in the specified directory</td></tr><tr class='oddRow'><td align='left'><code>--servewiki &lt;port&gt;</code></td><td align='left'>Serve the cooked <span data-tw-macro='link' data-tw-render-step='9'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlyWiki</a></span> over HTTP at <code>/</code></td></tr><tr class='evenRow'><td align='left'><code>--servetiddlers &lt;port&gt;</code></td><td align='left'>Serve individual tiddlers over HTTP at <code>/tiddlertitle</code></td></tr><tr class='oddRow'><td align='left'><code>--wikitest &lt;dir&gt;</code></td><td align='left'>Run wikification tests against the tiddlers in the given directory</td></tr><tr class='evenRow'><td align='left'><code>--dumpstore</code></td><td align='left'>Dump the <span data-tw-macro='link' data-tw-render-step='10'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlyWiki</a></span> store in JSON format</td></tr><tr class='oddRow'><td align='left'><code>--dumprecipe</code></td><td align='left'>Dump the current recipe in JSON format</td></tr><tr class='evenRow'><td align='left'><code>--verbose</code></td><td align='left'>verbose output, useful for debugging</td></tr></tbody></table><h2> Examples</h2>This example loads the tiddlers from a <span data-tw-macro='link' data-tw-render-step='11'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlyWiki</a></span> HTML file and makes them available over HTTP:<br><code>
node tiddlywiki.js --load mywiki.html --servewiki 127.0.0.1:8000
</code><br>This example cooks a <span data-tw-macro='link' data-tw-render-step='12'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> from a recipe:<br><code>
</code><br>This example cooks a <span data-tw-macro='link' data-tw-render-step='12'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlyWiki</a></span> from a recipe:<br><code>
node tiddlywiki.js --recipe tiddlywiki.com/index.recipe --savewiki tmp/
</code><br>This example ginsus a <span data-tw-macro='link' data-tw-render-step='13'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> into its constituent tiddlers:<br><code>
</code><br>This example ginsus a <span data-tw-macro='link' data-tw-render-step='13'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlyWiki</a></span> into its constituent tiddlers:<br><code>
node tiddlywiki.js --load mywiki.html --savetiddlers tmp/tiddlers
</code><br><h2> Notes</h2><code>--servewiki</code> and <code>--servertiddlers</code> are for different purposes and should not be used together. The former is for <span data-tw-macro='link' data-tw-render-step='14'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> core developers who want to be able to edit the <span data-tw-macro='link' data-tw-render-step='15'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> source files in a text editor and view the results in the browser by clicking refresh; it is slow because it reloads all the <span data-tw-macro='link' data-tw-render-step='16'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> <span data-tw-macro='link' data-tw-render-step='17'><a href='JavaScript' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JavaScript</a></span> files each time the page is loaded. The latter is for experimenting with the new wikification engine.<br><br><code>--wikitest</code> looks for <code>*.tid</code> files in the specified folder. It then wikifies the tiddlers to both &quot;text/plain&quot; and &quot;text/html&quot; format and checks the results against the content of the <code>*.html</code> and <code>*.txt</code> files in the same directory.</div></div><br><h1>Testing</h1><div data-tw-macro='tiddler' data-tw-render-step='4'><div data-tw-render-tiddler='Testing'><code>test.sh</code> contains a simple test script that cooks the main tiddlywiki.com recipe and compares it with the results of the old build process (ie, running cook.rb and then opening the file in a browser and performing a 'save changes' operation). It also runs a series of wikifications tests that work off the data in <code>test/wikitests/</code>.</div></div><br><h1>Architecture</h1><div data-tw-macro='tiddler' data-tw-render-step='5'><div data-tw-render-tiddler='TiddlyWikiArchitecture'><h2> Overview</h2><br>The heart of <span data-tw-macro='link' data-tw-render-step='1'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> can be seen as an extensible representation transformation engine. Given the text of a tiddler and its associated MIME type, the engine can produce a rendering of the tiddler in a new MIME type.<br><br>The most important transformations are from <code>text/x-tiddlywiki</code> wikitext into <code>text/html</code> or <code>text/plain</code> but the engine is used throughout the system for other transformations, such as converting images for display in HTML, sanitising fragments of <span data-tw-macro='link' data-tw-render-step='2'><a href='JavaScript' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JavaScript</a></span>, and processing CSS.<br><br><h2> Tiddlers</h2><br>Tiddlers are a dictionary of name:value pairs called fields.<br><br>The only field that is required is the <code>title</code> field, but useful tiddlers also have a <code>text</code> field, and some or all of the standard fields <code>modified</code>, <code>modifier</code>, <code>created</code>, <code>creator</code>, <code>tags</code> and <code>type</code>.<br><br>Hardcoded in the system is the knowledge that the <code>tags</code> field is a string array, and that the <code>modified</code> and <code>created</code> fields are <span data-tw-macro='link' data-tw-render-step='3'><a href='JavaScript' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JavaScript</a></span> <code>Date</code> objects. All other fields are strings.<br><br>The <code>type</code> field identifies the representation of the tiddler text with a MIME type.<br><br><h2> WikiStore</h2><br>Groups of uniquely titled tiddlers are contained in <span data-tw-macro='link' data-tw-render-step='4'><a href='WikiStore' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiStore</a></span> objects.<br><br>The <span data-tw-macro='link' data-tw-render-step='5'><a href='WikiStore' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiStore</a></span> also manages the plugin modules used for macros, and operations like serializing, deserializing, parsing and rendering tiddlers.<br><br>Each <span data-tw-macro='link' data-tw-render-step='6'><a href='WikiStore' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiStore</a></span> is connected to another shadow store that is used to provide default content. Under usual circumstances, when an attempt is made to retrieve a tiddler that doesn't exist in the store, the search continues into its shadow store (and so on, if the shadow store itself has a shadow store).<br><br><h2> WikiStore Events</h2><br>Clients can register event handlers with the <span data-tw-macro='link' data-tw-render-step='7'><a href='WikiStore' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiStore</a></sLine truncated
</code><br><h2> Notes</h2><code>--servewiki</code> and <code>--servertiddlers</code> are for different purposes and should not be used together. The former is for <span data-tw-macro='link' data-tw-render-step='14'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlyWiki</a></span> core developers who want to be able to edit the <span data-tw-macro='link' data-tw-render-step='15'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlyWiki</a></span> source files in a text editor and view the results in the browser by clicking refresh; it is slow because it reloads all the <span data-tw-macro='link' data-tw-render-step='16'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlyWiki</a></span> <span data-tw-macro='link' data-tw-render-step='17'><a href='JavaScript' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JavaScript</a></span> files each time the page is loaded. The latter is for experimenting with the new wikification engine.<br><br><code>--wikitest</code> looks for <code>*.tid</code> files in the specified folder. It then wikifies the tiddlers to both &quot;text/plain&quot; and &quot;text/html&quot; format and checks the results against the content of the <code>*.html</code> and <code>*.txt</code> files in the same directory.</div></div><br><h1>Testing</h1><div data-tw-macro='tiddler' data-tw-render-step='4'><div data-tw-render-tiddler='Testing'><code>test.sh</code> contains a simple test script that cooks the main tiddlywiki.com recipe and compares it with the results of the old build process (ie, running cook.rb and then opening the file in a browser and performing a 'save changes' operation). It also runs a series of wikifications tests that work off the data in <code>test/wikitests/</code>.</div></div><br><h1>Architecture</h1><div data-tw-macro='tiddler' data-tw-render-step='5'><div data-tw-render-tiddler='TiddlyWikiArchitecture'><h2> Overview</h2><br>The heart of <span data-tw-macro='link' data-tw-render-step='1'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlyWiki</a></span> can be seen as an extensible representation transformation engine. Given the text of a tiddler and its associated MIME type, the engine can produce a rendering of the tiddler in a new MIME type.<br><br>The most important transformations are from <code>text/x-tiddlywiki</code> wikitext into <code>text/html</code> or <code>text/plain</code> but the engine is used throughout the system for other transformations, such as converting images for display in HTML, sanitising fragments of <span data-tw-macro='link' data-tw-render-step='2'><a href='JavaScript' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JavaScript</a></span>, and processing CSS.<br><br><h2> Tiddlers</h2><br>Tiddlers are a dictionary of name:value pairs called fields.<br><br>The only field that is required is the <code>title</code> field, but useful tiddlers also have a <code>text</code> field, and some or all of the standard fields <code>modified</code>, <code>modifier</code>, <code>created</code>, <code>creator</code>, <code>tags</code> and <code>type</code>.<br><br>Hardcoded in the system is the knowledge that the <code>tags</code> field is a string array, and that the <code>modified</code> and <code>created</code> fields are <span data-tw-macro='link' data-tw-render-step='3'><a href='JavaScript' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JavaScript</a></span> <code>Date</code> objects. All other fields are strings.<br><br>The <code>type</code> field identifies the representation of the tiddler text with a MIME type.<br><br><h2> WikiStore</h2><br>Groups of uniquely titled tiddlers are contained in <span data-tw-macro='link' data-tw-render-step='4'><a href='WikiStore' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiStore</a></span> objects.<br><br>The <span data-tw-macro='link' data-tw-render-step='5'><a href='WikiStore' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiStore</a></span> also manages the plugin modules used for macros, and operations like serializing, deserializing, parsing and rendering tiddlers.<br><br>Each <span data-tw-macro='link' data-tw-render-step='6'><a href='WikiStore' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiStore</a></span> is connected to another shadow store that is used to provide default content. Under usual circumstances, when an attempt is made to retrieve a tiddler that doesn't exist in the store, the search continues into its shadow store (and so on, if the shadow store itself has a shadow store).<br><br><h2> WikiStore Events</h2><br>Clients can register event handlers with the <span data-tw-macro='link' data-tw-render-step='7'><a href='WikiStore' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiStore</aLine truncated
</pre>The function to render it to <code>text/html</code> might look like this:<br><pre>function() {
return &quot;&lt;p&gt;Hello World&lt;/p&gt;&quot;;
}
@@ -21,7 +21,7 @@ node tiddlywiki.js --load mywiki.html --savetiddlers tmp/tiddlers
return 2+2;
})().toString()].join(&quot;&quot;);
}
</pre><br>The compilation process has several steps:<br><ul><li> First, the parse tree is used to generate a <span data-tw-macro='link' data-tw-render-step='14'><a href='JavaScript' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JavaScript</a></span> tree</li><li> The <span data-tw-macro='link' data-tw-render-step='15'><a href='JavaScript' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JavaScript</a></span> tree is scanned to determine the tiddlers on which this one depends</li><li> Finally, executable <span data-tw-macro='link' data-tw-render-step='16'><a href='JavaScript' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JavaScript</a></span> text is generated by walking the <span data-tw-macro='link' data-tw-render-step='17'><a href='JavaScript' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JavaScript</a></span> tree</li></ul></div></div><br><h1>Planned <span data-tw-macro='link' data-tw-render-step='6'><a href='WikiText' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiText</a></span> Features</h1><div data-tw-macro='tiddler' data-tw-render-step='7'><div data-tw-render-tiddler='NewWikiTextFeatures'>It is proposed to extend the existing <span data-tw-macro='link' data-tw-render-step='1'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> wikitext syntax with the following extensions<br><br><ol><li> Addition of <code>**bold**</code> character formatting</li><li> Addition of <code>`backtick for code`</code> character formatting</li><li> Addition of <span data-tw-macro='link' data-tw-render-step='2'><a href='WikiCreole-style' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiCreole-style</a></span> forced line break, e.g. <code>force\\linebreak</code></li><li> Addition of <span data-tw-macro='link' data-tw-render-step='3'><a href='WikiCreole-style' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiCreole-style</a></span> headings, e.g. <code>==Heading</code></li><li> Addition of <span data-tw-macro='link' data-tw-render-step='4'><a href='WikiCreole-style' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiCreole-style</a></span> headings in tables, e.g. <code>|=|=table|=header|</code></li><li> Addition of white-listed HTML tags intermixed with wikitext</li><li> Addition of <span data-tw-macro='link' data-tw-render-step='5'><a href='WikiCreole-style' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiCreole-style</a></span> pretty links, e.g. <code>[[description -&gt; link]]</code></li><li> Addition of multiline macros, e.g.</li></ol><pre>&lt;&lt;myMacro
</pre><br>The compilation process has several steps:<br><ul><li> First, the parse tree is used to generate a <span data-tw-macro='link' data-tw-render-step='14'><a href='JavaScript' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JavaScript</a></span> tree</li><li> The <span data-tw-macro='link' data-tw-render-step='15'><a href='JavaScript' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JavaScript</a></span> tree is scanned to determine the tiddlers on which this one depends</li><li> Finally, executable <span data-tw-macro='link' data-tw-render-step='16'><a href='JavaScript' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JavaScript</a></span> text is generated by walking the <span data-tw-macro='link' data-tw-render-step='17'><a href='JavaScript' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JavaScript</a></span> tree</li></ul></div></div><br><h1>Planned <span data-tw-macro='link' data-tw-render-step='6'><a href='WikiText' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiText</a></span> Features</h1><div data-tw-macro='tiddler' data-tw-render-step='7'><div data-tw-render-tiddler='NewWikiTextFeatures'>It is proposed to extend the existing <span data-tw-macro='link' data-tw-render-step='1'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>TiddlyWiki</a></span> wikitext syntax with the following extensions<br><br><ol><li> Addition of <code>**bold**</code> character formatting</li><li> Addition of <code>`backtick for code`</code> character formatting</li><li> Addition of <span data-tw-macro='link' data-tw-render-step='2'><a href='WikiCreole-style' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiCreole-style</a></span> forced line break, e.g. <code>force\\linebreak</code></li><li> Addition of <span data-tw-macro='link' data-tw-render-step='3'><a href='WikiCreole-style' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiCreole-style</a></span> headings, e.g. <code>==Heading</code></li><li> Addition of <span data-tw-macro='link' data-tw-render-step='4'><a href='WikiCreole-style' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiCreole-style</a></span> headings in tables, e.g. <code>|=|=table|=header|</code></li><li> Addition of white-listed HTML tags intermixed with wikitext</li><li> Addition of <span data-tw-macro='link' data-tw-render-step='5'><a href='WikiCreole-style' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiCreole-style</a></span> pretty links, e.g. <code>[[description -&gt; link]]</code></li><li> Addition of multiline macros, e.g.</li></ol><pre>&lt;&lt;myMacro
param1: Parameter value
param2: value
&quot;unnamed parameter&quot;
@@ -7,7 +7,7 @@ Usage:
`
node tiddlywiki.js <options>
`
The command line options are processed sequentially from left to right. Processing pauses during long operations, like loading a [[recipe file|RecipeFiles]] and all the subrecipes and [[tiddlers|TiddlerFiles]] that it references. The following options are available:
The command line options are processed sequentially from left to right. Processing pauses during long operations, like loading a [[recipe file|RecipeFiles]] and all the subrecipes and [[tiddlers|TiddlerFiles]] that it references, and then resumes with the next command line option in sequence. The following options are available:
|`--recipe <filepath>` |Loads a specfied `.recipe` file |
|`--load <filepath>` |Load additional tiddlers from 2.x.x TiddlyWiki files (`.html`), `.tiddler`, `.tid`, `.json` or other files |
|`--savewiki <dirpath>` |Saves all the loaded tiddlers as a single file TiddlyWiki called `index.html` and an RSS feed called `index.xml` in a new directory of the specified name |
+17 -5
View File
@@ -1,15 +1,27 @@
title: HelloThere
modifier: JeremyRuston
<<view title link>>
Welcome to TiddlyWiki5, a reboot of TiddlyWiki, the venerable, reusable non-linear personal web notebook first released in 2004. It is a complete interactive wiki that can run from a single HTML file or as a powerful [[node.js application|What is node.js?]].
Welcome to TiddlyWiki5, a reboot of the venerable, reusable non-linear personal web notebook first released in 2004. It is a complete interactive wiki that can run from a single HTML file or as a powerful `node.js` application.
Some useful tiddlers for feature testing:
* ImageTests showing different ways of embedding images
* SampleData showing how JSON tiddlers are handled
* VideoTests showing how different online video formats can be embedded
TiddlyWiki is based on the idea of making information more useful by modelling it in the smallest meaningful semantic units, referred to as "tiddlers". Structure comes from links, tags, and stories (sequences of tiddlers). Tiddlers use a wikitext notation that concisely represents a wide range of text formatting and hypertext features.
TiddlyWiki has earned an enduring role as a tool that people [[love using|Raves]] for its rich, interactive interface to [[manipulate complex data|TiddlyWikiConcepts]] with structure that doesn't easily fit into conventional tools like spreadsheets or wordprocessors. Because people can use it without needing any complicated server infrastructure, and because it is [[open source|OpenSourceLicense]], it has bought unprecedented freedom to people to keep their precious information under their own control. TiddlyWiki was originally created by JeremyRuston and is now a thriving [[open source|OpenSourceLicense]] project with a busy [[Community]] of independent developers.
Technical documentation includes:
* [[Testing]] regimen
* Details of the CommandLineInterface
* Overview of TiddlyWikiArchitecture
** MacroInternals
* Information about TiddlerFiles and RecipeFiles
* NewWikiTextFeatures
TiddlyWiki5 is currently in early beta, which is to say that it is useful but incomplete. You can get involved in the development on GitHub and the discussions on Google Groups:
https://github.com/Jermolene/TiddlyWiki5
http://groups.google.com/group/TiddlyWikiDev
<<<
Bug: this link doesn't work:
<<view title link>>
<<<
+37 -4
View File
@@ -1,21 +1,29 @@
title: MacroInternals
! Macro Fields
Macros are conventional JavaScript modules that export a single variable called `macro` that contains:
|!Field Name |!Description |
|`name` |The name of the macro |
|`types` |An array of the MIME types that the macro can render |
|`params` |A hashmap of the parameters accepted by the macro (see below) |
|`handler` |The macro rendering function (see below) |
|`events` |An optional hashmap of event handling functions (see below) |
|`render` |The macro rendering function (see below) |
|`rerender` |The optional macro rerendering function (see below) |
|`dependentAll` |True if the macro needs access to all available tiddlers |
! Macro Parameters
The `params` hashmap provides the following fields about each parameter:
|!Param Field Name |!Description |
|`byName` |Provided if the parameter should be referenced by name. The value can be `true` or `"default"` to indicate that the parameter should accept anonymous parameters |
|`type` |The type of the parameter, from `text` or `tiddler` (used for dependency tracking) |
|`byName` |Provided if the parameter should be referenced by name. The value can be `true` or `"default"` to indicate that anonymous parameters are acceptable |
|`type` |The type of the parameter, either `text` or `tiddler` (used for dependency tracking) |
|`rel` |The relationship for parameters of type tiddler - either "link" or "include" |
|`optional` |`true` if the parameter is optional |
The `code` function is called with the following parameters:
! Macro Rendering
The `render` function should return the new text representation of the macro output. It is called with the following parameters:
|!Param Name |!Description |
|`type` |The target MIME type for rendering the macro |
@@ -23,3 +31,28 @@ The `code` function is called with the following parameters:
|`store` |The `WikiStore` object to be used |
|`params` |The macro parameters as a hashmap |
|`content` |The rendered text of the children of the macro |
!Macro Rerendering
The `rerender` function is called with the following parameters:
|!Param Name |!Description |
|`node` |The DOM node containing the existing rendering of the macro |
|`changes` |Hashmap of `{title: "created|modified|deleted"}` |
|`type` |The target MIME type for rendering the macro |
|`tiddler` |The tiddler in whose context the macro is being rendered |
|`store` |The `WikiStore` object to be used |
|`params` |The macro parameters as a hashmap |
|`content` |The rendered text of the children of the macro |
!Macro Event Handlers
Event handlers are called with the following parameters:
|!Param Name |!Description |
|`event` |The DOM node containing the existing rendering of the macro |
|`node` |Hashmap of `{title: "created|modified|deleted"}` |
|`tiddler` |The tiddler in whose context the macro is being rendered |
|`store` |The `WikiStore` object to be used |
|`params` |The macro parameters as a hashmap |
Event handlers should return `false` if they handle the event (and generally should also call `event.preventDefault()`), and `true` if they do not.
+5
View File
@@ -0,0 +1,5 @@
title: TiddlyWiki
TiddlyWiki is based on the idea of making information more useful by modelling it in the smallest meaningful semantic units, referred to as "tiddlers". Structure comes from links, tags, and stories (sequences of tiddlers). Tiddlers use a wikitext notation that concisely represents a wide range of text formatting and hypertext features.
TiddlyWiki has earned an enduring role as a tool that people [[love using|Raves]] for its rich, interactive interface to manipulate complex data with structure that doesn't easily fit into conventional tools like spreadsheets or wordprocessors. Because people can use it without needing any complicated server infrastructure, and because it is [[open source|What is open source?]], it has bought unprecedented freedom to people to keep their precious information under their own control. TiddlyWiki was originally created by JeremyRuston and is now a thriving [[open source|What is open source?]] project with a busy [[Community]] of independent developers.