diff --git a/readme.md b/readme.md index d5d1a011e..913e6f793 100644 --- a/readme.md +++ b/readme.md @@ -24,15 +24,5 @@ renderer.rerender(node,changes,tiddler,store,renderStep);

The parameters |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.

Plugin Mechanism

Introduction

TiddlyWiki5 is based on a 500 line boot kernel that runs on node.js or in the browser, and everything else is plugins.

The kernel boots just enough of the TiddlyWiki 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 node.js modules; you can use require() to invoke sub components and to control load order.

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 tags field, and another that knows how to handle the special behaviour of the modified and created fields.

Some plugins have further sub-plugins: the wikitext parser, for instance, accepts rules as individual plugins.

Plugins and Modules

In TiddlyWiki5, a plugin is a bundle of related tiddlers that are distributed together as a single unit. Plugins can include tiddlers which are JavaScript modules.

The file core/boot.js is a barebones TiddlyWiki 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.

The kernel includes:

Each module is an ordinary node.js-style module, using the require() function to access other modules and the exports global to return JavaScript values. The boot kernel smooths over the differences between node.js and the browser, allowing the same plugin modules to execute in both environments.

In the browser, core/boot.js is packed into a template HTML file that contains the following elements in order:

On the server, core/boot.js is executed directly. It uses the node.js local file API to load plugins directly from the file system in the core/modules directory. The code loading is performed synchronously for brevity (and because the system is in any case inherently blocked until plugins are loaded).

The boot kernel sets up the $tw global variable that is used to store all the state data of the system.

Core

The 'core' is the boot kernel plus the set of plugin modules that it loads. It contains plugins of the following types:

TiddlyWiki5 makes extensive use of JavaScript inheritance:

tiddlywiki.plugin files -

Planned WikiText Features

It is proposed to extend the existing TiddlyWiki WikiText syntax with the following extensions

  1. Addition of **bold** character formatting
  2. Addition of `backtick for code` character formatting
  3. Addition of WikiCreole-style forced line break, e.g. force\\linebreak
  4. Addition of WikiCreole-style headings, e.g. ==Heading
  5. Addition of WikiCreole-style headings in tables, e.g. |=|=table|=header|
  6. Addition of white-listed HTML and SVG tags intermixed with wikitext
  7. Addition of WikiCreole-style pretty links, e.g. [[description -> link]]
  8. 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.
-))
->>
  1. Addition of typed text blocks, e.g.
	$$$.js
-		return "This will have syntax highlighting applied"
-	$$$

This readme file was automatically generated by TiddlyWiki5 +

Planned WikiText Features

This readme file was automatically generated by TiddlyWiki5

\ No newline at end of file diff --git a/tw5.com/tiddlers/Docs.tid b/tw5.com/tiddlers/Docs.tid new file mode 100644 index 000000000..97f6557f7 --- /dev/null +++ b/tw5.com/tiddlers/Docs.tid @@ -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]] + diff --git a/tw5.com/tiddlers/ImageMacro.tid b/tw5.com/tiddlers/ImageMacro.tid new file mode 100644 index 000000000..f6b6b5b44 --- /dev/null +++ b/tw5.com/tiddlers/ImageMacro.tid @@ -0,0 +1,26 @@ +title: ImageMacro +tags: docs macro + +The ImageMacro displays an image with an optional tooltip. + +! Parameters + +! Examples + +{{{ +<> +}}} + +Appears as: + +<> + +{{{ +<> +}}} + +Appears as: + +<> + +(Hover over the image to see the tooltip). diff --git a/tw5.com/tiddlers/ImageTests.tid b/tw5.com/tiddlers/ImageTests.tid deleted file mode 100644 index f4811cd4d..000000000 --- a/tw5.com/tiddlers/ImageTests.tid +++ /dev/null @@ -1,60 +0,0 @@ -title: ImageTests -tags: demo - -This tiddler demonstrates different ways of displaying images - -{{{ -<> -}}} - -Appears as: - -<> - -{{{ -<> -}}} - -Appears as: - -<> - -{{{ -[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/]] - -{{{ -<> -}}} - -Appears as: - -<> - -{{{ -[img[Tiddler Fishes.svg]] -}}} - -Appears as: - -[img[Tiddler Fishes.svg]] diff --git a/tw5.com/tiddlers/ImageWikiText.tid b/tw5.com/tiddlers/ImageWikiText.tid new file mode 100644 index 000000000..d17f71582 --- /dev/null +++ b/tw5.com/tiddlers/ImageWikiText.tid @@ -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[]] +[img[]] +[img[|]] +[img[|][]] +}}} + +! 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/]] diff --git a/tw5.com/tiddlers/Introduction.tid b/tw5.com/tiddlers/Introduction.tid index d435269e0..23b5163fa 100644 --- a/tw5.com/tiddlers/Introduction.tid +++ b/tw5.com/tiddlers/Introduction.tid @@ -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: <> -{{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) -}}} +
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 diff --git a/tw5.com/tiddlers/JackSlider.tid b/tw5.com/tiddlers/JackSlider.tid index 542f048dd..6ad6f4070 100644 --- a/tw5.com/tiddlers/JackSlider.tid +++ b/tw5.com/tiddlers/JackSlider.tid @@ -1,4 +1,3 @@ title: JackSlider -modifier: JackBeNimble closed diff --git a/tw5.com/tiddlers/NewWikiTextFeatures.tid b/tw5.com/tiddlers/NewWikiTextFeatures.tid deleted file mode 100644 index eb7efa015..000000000 --- a/tw5.com/tiddlers/NewWikiTextFeatures.tid +++ /dev/null @@ -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. -{{{ -<> -}}} -# Addition of typed text blocks, e.g. -{{{ - $$$.js - return "This will have syntax highlighting applied" - $$$ -}}} diff --git a/tw5.com/tiddlers/PluginMechanism.tid b/tw5.com/tiddlers/PluginMechanism.tid index 326e494fd..73f6a04f7 100644 --- a/tw5.com/tiddlers/PluginMechanism.tid +++ b/tw5.com/tiddlers/PluginMechanism.tid @@ -1,5 +1,5 @@ title: PluginMechanism -tags: internals +tags: docs mechanism !Introduction diff --git a/tw5.com/tiddlers/SampleJavaScript.tid b/tw5.com/tiddlers/SampleJavaScriptTiddler.tid similarity index 84% rename from tw5.com/tiddlers/SampleJavaScript.tid rename to tw5.com/tiddlers/SampleJavaScriptTiddler.tid index 12cc022f5..e8f57da5e 100644 --- a/tw5.com/tiddlers/SampleJavaScript.tid +++ b/tw5.com/tiddlers/SampleJavaScriptTiddler.tid @@ -1,4 +1,4 @@ -title: SampleJavaScript +title: SampleJavaScriptTiddler type: application/javascript tags: demo diff --git a/tw5.com/tiddlers/SampleJavaScriptWithError.tid b/tw5.com/tiddlers/SampleJavaScriptTiddlerWithError.tid similarity index 85% rename from tw5.com/tiddlers/SampleJavaScriptWithError.tid rename to tw5.com/tiddlers/SampleJavaScriptTiddlerWithError.tid index 9d339cb7e..423ef3e73 100644 --- a/tw5.com/tiddlers/SampleJavaScriptWithError.tid +++ b/tw5.com/tiddlers/SampleJavaScriptTiddlerWithError.tid @@ -1,4 +1,4 @@ -title: SampleJavaScriptWithError +title: SampleJavaScriptTiddlerWithError type: application/javascript tags: demo diff --git a/tw5.com/tiddlers/SampleData.tid b/tw5.com/tiddlers/SampleJsonTiddler.tid similarity index 96% rename from tw5.com/tiddlers/SampleData.tid rename to tw5.com/tiddlers/SampleJsonTiddler.tid index d20f196ad..8f117a241 100644 --- a/tw5.com/tiddlers/SampleData.tid +++ b/tw5.com/tiddlers/SampleJsonTiddler.tid @@ -1,4 +1,4 @@ -title: SampleData +title: SampleJsonTiddler type: application/json tags: demo diff --git a/tw5.com/tiddlers/ShadowTiddlers.tid b/tw5.com/tiddlers/ShadowTiddlers.tid index d8eb665f6..245b6d587 100644 --- a/tw5.com/tiddlers/ShadowTiddlers.tid +++ b/tw5.com/tiddlers/ShadowTiddlers.tid @@ -1,3 +1,4 @@ title: ShadowTiddlers +tags: docs concepts <> diff --git a/tw5.com/tiddlers/SliderTests.tid b/tw5.com/tiddlers/SliderMacro.tid similarity index 95% rename from tw5.com/tiddlers/SliderTests.tid rename to tw5.com/tiddlers/SliderMacro.tid index a9bef4e46..4f9969c47 100644 --- a/tw5.com/tiddlers/SliderTests.tid +++ b/tw5.com/tiddlers/SliderMacro.tid @@ -1,5 +1,5 @@ -title: SliderTests -tags: demo +title: SliderMacro +tags: docs macro The status of this slider is stored in the tiddler JackSlider: diff --git a/tw5.com/tiddlers/TestingNewWikiText.tid b/tw5.com/tiddlers/WikiText.tid similarity index 81% rename from tw5.com/tiddlers/TestingNewWikiText.tid rename to tw5.com/tiddlers/WikiText.tid index 362ffee0f..6c134cc93 100644 --- a/tw5.com/tiddlers/TestingNewWikiText.tid +++ b/tw5.com/tiddlers/WikiText.tid @@ -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 `<>`. ! This is a heading diff --git a/tw5.com/wiki/StoryTiddlers.tid b/tw5.com/wiki/StoryTiddlers.tid index 5d25868de..e8ec1424b 100644 --- a/tw5.com/wiki/StoryTiddlers.tid +++ b/tw5.com/wiki/StoryTiddlers.tid @@ -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"} ] } \ No newline at end of file