From 85f1b33ef28dbb3b663e606de13219cc51489a4f Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sun, 20 May 2012 18:47:11 +0100 Subject: [PATCH] Docs updates --- core/modules/wiki.filters.js | 53 ------------------ readme.md | 6 +- tw5.com/tiddlers/Command Line Sketch.jpg.meta | 2 +- tw5.com/tiddlers/CommandLineInterface.tid | 1 + tw5.com/tiddlers/HelloThere.tid | 3 +- tw5.com/tiddlers/ImageTests.tid | 1 + tw5.com/tiddlers/Introduction.tid | 2 +- tw5.com/tiddlers/Main Screen Sketch.jpg.meta | 2 +- tw5.com/tiddlers/Motovun Jack.jpg.meta | 2 +- tw5.com/tiddlers/Motovun Jack.svg.meta | 2 +- tw5.com/tiddlers/NewWikiTextFeatures.tid | 1 + tw5.com/tiddlers/PluginMechanism.tid | 4 +- tw5.com/tiddlers/ReadMe.tid | 1 + tw5.com/tiddlers/SampleData.tid | 1 + tw5.com/tiddlers/SampleJavaScript.tid | 1 + .../tiddlers/SampleJavaScriptWithError.tid | 1 + tw5.com/tiddlers/SliderTests.tid | 1 + tw5.com/tiddlers/Tiddler Fishes.svg.meta | 2 +- tw5.com/tiddlers/TiddlerFiles.tid | 1 + tw5.com/tiddlers/TiddlerFilters.tid | 55 +++++++++++++++++++ tw5.com/tiddlers/TiddlyWiki.tid | 1 + tw5.com/tiddlers/TiddlyWikiArchitecture.tid | 1 + tw5.com/tiddlers/TryingOutTiddlyWiki.tid | 1 + tw5.com/tiddlers/TypedBlockTests.tid | 1 + tw5.com/tiddlers/VideoTests.tid | 1 + .../tiddlers/View Switcher Sketch.jpg.meta | 2 +- tw5.com/tiddlers/WaysToUseTiddlyWiki.tid | 1 + 27 files changed, 85 insertions(+), 65 deletions(-) create mode 100644 tw5.com/tiddlers/TiddlerFilters.tid diff --git a/core/modules/wiki.filters.js b/core/modules/wiki.filters.js index da970ddfa..c4eb69507 100644 --- a/core/modules/wiki.filters.js +++ b/core/modules/wiki.filters.js @@ -5,59 +5,6 @@ module-type: wikimethod Adds tiddler filtering to the $tw.Wiki object. -TiddlyWiki has a special syntax for expressing filters. They can be used to select tiddlers for an operation, or to filter a set of tiddlers to add or remove members. - -The mechanism is easiest to understand by first presenting some example filter strings: - -|!Filter |!Results | -|`HelloThere` |The single tiddler titled `HelloThere` (if it exists) | -|`[[A Title With Several Words]]` |The single tiddler titled `A Title With Several Words` (if it exists) | -|`[title[MyTiddler]]` |The single tiddler titled `MyTiddler` (if it exists) | -|`HelloThere Introduction` |The tiddlers titled `HelloThere` and `Introduction` (if they exist) | -|`[tag[important]]` |Any tiddlers with the tag `important` | -|`[!tag[important]]` |Any tiddlers not with the tag `important` | -|`[tag[important]sort[title]]` |Any tiddlers with the tag `important` sorted by title | -|`[tag[important]!sort[title]]` |Any tiddlers with the tag `important` reverse sorted by title | -|`[[one][two][three]tag[tom]]` |Any of the tiddlers called `one`, `two` or `three` that exist and are tagged with `tom` | -|`[[one][two][three]] [tag[tom]]` |Any of the tiddlers called `one`, `two` or `three` that exist, along with all of the source tiddlers that are tagged with `tom` | -|`[tag[tom]] [tag[harry]] -[[one][two][three]]` |All tiddlers tagged either `tom` or `harry`, but excluding `one`, `two` and `three` | - -[[one]] [[two]] [tag[three]] -[[four]] +[sort[title]] -[tag[important]] -[[one][two]] -[[three]] +[sort[-modified]limit[20]] - -A filter string consists of one or more filter operations, each comprising one or more filter operators with associated operands. - -The operators look like `[operator[operand]]`, where `operator` is one of: -* ''title'': selects the tiddler with the title given in the operand -* ''is'': tests whether a tiddler is a member of the system defined set named in the operand (see below) -* ''has'': tests whether a tiddler has a specified field -* ''sort'': sorts the tiddlers by a given field -* ''limit'': limits the number of subresults -* ''tag'': tests whether a given tag is (`[tag[mytag]]`) or is not (`[!tag[mytag]]`) present on the tiddler -* '''': tests whether a tiddler field has a specified value (`[modifier[Jeremy]]`) or not (`[!modifier[Jeremy]]`) - -An operator can be negated with by preceding it with `!`, for example `[!tag[Tommy]]` selects the tiddlers that are not tagged with `Tommy`. - -The operator defaults to `title` if omitted, so `[[HelloThere]]` is equivalent to `[title[HelloThere]]`. If there are no spaces in the title, then the double square brackets can also be omitted: `HelloThere`. - -The operands available with the `is` operator are: -* ''tiddler'': selects all ordinary (non-shadow) tiddlers - -Operators are combined into logically ANDed expressions by bashing them together and merging the square brackets: -{{{ -[tag[one]] [tag[two]] ---> [tag[one]tag[two]] -}}} - -Operations can be preceded with `-` to negate their action, removing the selected tiddlers from the results. For example, `[tag[Tommy]] -HelloThere -[[Another One]]` selects all tiddlers tagged with `Tommy` except those titled `HelloThere` or `Another One`. - -Operations can be preceded with `+` in order to make them apply to all of the current results, rather than the original source. For example, `[tag[Jeremy]] [tag[Tommy]] +[sort[title]]` selects the tiddlers tagged `Tommy` or `Jeremy`, and sorts them by the `title` field. - -Filters are processed with the following elements: -* a string of filter operations, each made up of one or more filter operators -* the incoming source tiddlers -* the overall result stack -* the subresult stack of the tiddlers selected by the current operation - \*/ (function(){ diff --git a/readme.md b/readme.md index 55091e55d..e7efdfde8 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,6 @@ -

Welcome to TiddlyWiki5

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 in the browser or as a powerful node.js application.

TiddlyWiki5 is currently at version 5.0.0.a2 and is under active development, which is to say that it is useful but incomplete. You can try out the online prototype at http://tiddlywiki.com/tiddlywiki5, try out the command line incarnation, get involved in the development on GitHub or join the discussions on the TiddlyWikiDev Google Group.

Usage

TiddlyWiki5 can be used on the command line to perform an extensive set of operations based on tiddlers, TiddlerFiles and TiddlyWikiFiles. For example, this loads the tiddlers from a TiddlyWiki HTML file and then saves one of them in HTML:
node core/boot.js --verbose --load mywiki.html --savetiddler ReadMe ./readme.html
+

Welcome to TiddlyWiki5

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 in the browser or as a powerful [[node.js application|What is node.js?]]. + +TiddlyWiki5 is currently at version <<version>> and is under active development, which is to say that it is useful but incomplete. You can try out the online prototype at http://tiddlywiki.com/tiddlywiki5, [[try out the command line incarnation|TryingOutTiddlyWiki]], get involved in the [[development on GitHub|https://github.com/Jermolene/TiddlyWiki5]] or join the discussions on [[the TiddlyWikiDev Google Group|http://groups.google.com/group/TiddlyWikiDev]].

Usage

TiddlyWiki5 can be used on the command line to perform an extensive set of operations based on tiddlers, TiddlerFiles and TiddlyWikiFiles. For example, this loads the tiddlers from a TiddlyWiki HTML file and then saves one of them in HTML:
node core/boot.js --verbose --load mywiki.html --savetiddler ReadMe ./readme.html
 

Usage

Running boot.js from the command line boots the TiddlyWiki kernel, loads the core plugins and establishes an empty wiki store. It then sequentially processes the command line arguments from left to right. The arguments are separated with spaces. The commands are identified by the prefix --.
node core/boot.js [--<option> [<arg>[,<arg>]]]
 

Commands

The following commands are available.

load

Load tiddlers from 2.x.x TiddlyWiki files (.html), .tiddler, .tid, .json or other files
--load <filepath>
 

savetiddler

Save an individual tiddler as a specified MIME type, defaults to text/html
--savetiddler <title> <filename> [<type>]
@@ -29,7 +31,7 @@ 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:
NameDescription
nodeA reference to the DOM node containing the rendering to be rerendered
changesA hashmap of {title: "created|modified|deleted"} indicating which tiddlers have changed since the original rendering
tiddlerThe tiddler providing the rendering context
storeThe store to use for resolving references to other tiddlers
renderStepSee 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:
  • Eight short shared utility functions
  • Three methods implementing the plugin module mechanism
  • The $tw.Tiddler class (and three field definition plugins)
  • The $tw.Wiki class (and three tiddler deserialization methods)
  • Code for the browser to load tiddlers from the HTML DOM
  • Code for the server to load tiddlers from the file system

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:

  • Ordinary and shadow tiddlers, packed as HTML <DIV> elements
  • core/bootprefix.js, containing a few lines to set up the plugin environment
  • Plugin JavaScript modules, packed as HTML <SCRIPT> blocks
  • core/boot.js, containing the boot kernel

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:
  • tiddlerfield - defines the characteristics of tiddler fields of a particular name
  • tiddlerdeserializer - methods to extract tiddlers from text representations or the DOM
  • startup - functions to be called by the kernel after booting
  • global - members of the $tw global
  • config - values to be merged over the $tw.config global
  • utils - general purpose utility functions residing in $tw.utils
  • tiddlermethod - additional methods for the $tw.Tiddler class
  • wikimethod - additional methods for the $tw.Wiki class
  • treeutils - static utility methods for parser tree nodes
  • treenode - classes of parser tree nodes
  • macro - macro definitions
  • editor - interactive editors for different types of content
  • parser - parsers for different types of content
  • wikitextrule - individual rules for the wikitext parser
  • command - individual commands for the $tw.Commander class

TiddlyWiki5 makes extensive use of JavaScript inheritance:
  • Tree nodes defined in $:/core/treenodes/ all inherit from $:/core/treenodes/node.js
  • Macros defined in $:/core/macros/ all inherit from $:/core/treenodes/macro.js

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
+
The parameters to rerender() are:
NameDescription
nodeA reference to the DOM node containing the rendering to be rerendered
changesA hashmap of {title: "created|modified|deleted"} indicating which tiddlers have changed since the original rendering
tiddlerThe tiddler providing the rendering context
storeThe store to use for resolving references to other tiddlers
renderStepSee 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:
  • Eight short shared utility functions
  • Three methods implementing the plugin module mechanism
  • The $tw.Tiddler class (and three field definition plugins)
  • The $tw.Wiki class (and three tiddler deserialization methods)
  • Code for the browser to load tiddlers from the HTML DOM
  • Code for the server to load tiddlers from the file system

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:

  • Ordinary and shadow tiddlers, packed as HTML <DIV> elements
  • core/bootprefix.js, containing a few lines to set up the plugin environment
  • Plugin JavaScript modules, packed as HTML <SCRIPT> blocks
  • core/boot.js, containing the boot kernel

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:
  • tiddlerfield - defines the characteristics of tiddler fields of a particular name
  • tiddlerdeserializer - methods to extract tiddlers from text representations or the DOM
  • startup - functions to be called by the kernel after booting
  • global - members of the $tw global
  • config - values to be merged over the $tw.config global
  • utils - general purpose utility functions residing in $tw.utils
  • tiddlermethod - additional methods for the $tw.Tiddler class
  • wikimethod - additional methods for the $tw.Wiki class
  • treeutils - static utility methods for parser tree nodes
  • treenode - classes of parser tree nodes
  • macro - macro definitions
  • editor - interactive editors for different types of content
  • parser - parsers for different types of content
  • wikitextrule - individual rules for the wikitext parser
  • command - individual commands for the $tw.Commander class

TiddlyWiki5 makes extensive use of JavaScript inheritance:
  • Tree nodes defined in $:/core/treenodes/ all inherit from $:/core/treenodes/node.js
  • Macros defined in $:/core/macros/ all inherit from $:/core/treenodes/macro.js

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"
diff --git a/tw5.com/tiddlers/Command Line Sketch.jpg.meta b/tw5.com/tiddlers/Command Line Sketch.jpg.meta
index 893122a08..4578890a3 100644
--- a/tw5.com/tiddlers/Command Line Sketch.jpg.meta	
+++ b/tw5.com/tiddlers/Command Line Sketch.jpg.meta	
@@ -1,4 +1,4 @@
 title: Command Line Sketch.jpg
 modifier: JeremyRuston
 type: image/jpeg
-tags: Picture
+tags: picture
diff --git a/tw5.com/tiddlers/CommandLineInterface.tid b/tw5.com/tiddlers/CommandLineInterface.tid
index 806c11db9..a7a626b4e 100644
--- a/tw5.com/tiddlers/CommandLineInterface.tid
+++ b/tw5.com/tiddlers/CommandLineInterface.tid
@@ -1,5 +1,6 @@
 title: CommandLineInterface
 modifier: JeremyRuston
+tags: feature
 
 TiddlyWiki5 can be used on the command line to perform an extensive set of operations based on tiddlers, TiddlerFiles and TiddlyWikiFiles. For example, this loads the tiddlers from a TiddlyWiki HTML file and then saves one of them in HTML:
 {{{
diff --git a/tw5.com/tiddlers/HelloThere.tid b/tw5.com/tiddlers/HelloThere.tid
index 0ab8cf688..b32c5d4bf 100644
--- a/tw5.com/tiddlers/HelloThere.tid
+++ b/tw5.com/tiddlers/HelloThere.tid
@@ -1,6 +1,7 @@
 title: HelloThere
 modifier: JeremyRuston
-tags: Introduction
+tags: introduction
+type: text/x-tiddlywiki-new
 
 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 in the browser or as a powerful [[node.js application|What is node.js?]].
 
diff --git a/tw5.com/tiddlers/ImageTests.tid b/tw5.com/tiddlers/ImageTests.tid
index 188c96b90..d8f229b9b 100644
--- a/tw5.com/tiddlers/ImageTests.tid
+++ b/tw5.com/tiddlers/ImageTests.tid
@@ -1,4 +1,5 @@
 title: ImageTests
+tags: demo
 
 This tiddler demonstrates different ways of displaying images
 {{{
diff --git a/tw5.com/tiddlers/Introduction.tid b/tw5.com/tiddlers/Introduction.tid
index d884a50f9..3aab403b6 100644
--- a/tw5.com/tiddlers/Introduction.tid
+++ b/tw5.com/tiddlers/Introduction.tid
@@ -1,5 +1,5 @@
 title: Introduction
-tags: Introduction
+tags: introduction
 
 TiddlyWiki5 gains new capabilities through a [[completely rebuilt architecture|TiddlyWikiArchitecture]] using the latest features of HTML5 and node.js. It runs natively under node.js, and can also use its own components to construct a version of itself that works entirely within the browser, just as TiddlyWiki has always done.
 
diff --git a/tw5.com/tiddlers/Main Screen Sketch.jpg.meta b/tw5.com/tiddlers/Main Screen Sketch.jpg.meta
index fe266b335..bb1699595 100644
--- a/tw5.com/tiddlers/Main Screen Sketch.jpg.meta	
+++ b/tw5.com/tiddlers/Main Screen Sketch.jpg.meta	
@@ -1,4 +1,4 @@
 title: Main Screen Sketch.jpg
 modifier: JeremyRuston
 type: image/jpeg
-tags: Picture
+tags: picture
diff --git a/tw5.com/tiddlers/Motovun Jack.jpg.meta b/tw5.com/tiddlers/Motovun Jack.jpg.meta
index 94d710d3b..efe4e8aa7 100644
--- a/tw5.com/tiddlers/Motovun Jack.jpg.meta	
+++ b/tw5.com/tiddlers/Motovun Jack.jpg.meta	
@@ -1,4 +1,4 @@
 title: Motovun Jack.jpg
 type: image/jpeg
 source: http://www.flickr.com/photos/jermy/6292279493/in/photostream
-tags: Picture
+tags: picture
diff --git a/tw5.com/tiddlers/Motovun Jack.svg.meta b/tw5.com/tiddlers/Motovun Jack.svg.meta
index 5b04c87f1..65f54c13e 100644
--- a/tw5.com/tiddlers/Motovun Jack.svg.meta	
+++ b/tw5.com/tiddlers/Motovun Jack.svg.meta	
@@ -1,3 +1,3 @@
 title: Motovun Jack.svg
 type: image/svg+xml
-tags: Picture
+tags: picture
diff --git a/tw5.com/tiddlers/NewWikiTextFeatures.tid b/tw5.com/tiddlers/NewWikiTextFeatures.tid
index 64aab2ad1..eb7efa015 100644
--- a/tw5.com/tiddlers/NewWikiTextFeatures.tid
+++ b/tw5.com/tiddlers/NewWikiTextFeatures.tid
@@ -1,5 +1,6 @@
 title: NewWikiTextFeatures
 modifier: JeremyRuston
+tags: feature
 
 It is proposed to extend the existing TiddlyWiki WikiText syntax with the following extensions
 
diff --git a/tw5.com/tiddlers/PluginMechanism.tid b/tw5.com/tiddlers/PluginMechanism.tid
index 132a53695..4f4970c4e 100644
--- a/tw5.com/tiddlers/PluginMechanism.tid
+++ b/tw5.com/tiddlers/PluginMechanism.tid
@@ -1,8 +1,8 @@
 title: PluginMechanism
+tags: internals
 
 !Introduction
-TiddlyWiki5 is based on a 500 line boot kernel that runs on node.js or in the browser, and everything
-else is plugins.
+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.
 
diff --git a/tw5.com/tiddlers/ReadMe.tid b/tw5.com/tiddlers/ReadMe.tid
index 76c52e94e..95673d4e0 100644
--- a/tw5.com/tiddlers/ReadMe.tid
+++ b/tw5.com/tiddlers/ReadMe.tid
@@ -1,4 +1,5 @@
 title: ReadMe
+tags: introduction
 
 !Welcome to TiddlyWiki5
 <>
diff --git a/tw5.com/tiddlers/SampleData.tid b/tw5.com/tiddlers/SampleData.tid
index 2d1277773..d20f196ad 100644
--- a/tw5.com/tiddlers/SampleData.tid
+++ b/tw5.com/tiddlers/SampleData.tid
@@ -1,5 +1,6 @@
 title: SampleData
 type: application/json
+tags: demo
 
 {
     "glossary": {
diff --git a/tw5.com/tiddlers/SampleJavaScript.tid b/tw5.com/tiddlers/SampleJavaScript.tid
index 5c9f8d7fd..12cc022f5 100644
--- a/tw5.com/tiddlers/SampleJavaScript.tid
+++ b/tw5.com/tiddlers/SampleJavaScript.tid
@@ -1,5 +1,6 @@
 title: SampleJavaScript
 type: application/javascript
+tags: demo
 
 /*
 This is an example JavaScript file
diff --git a/tw5.com/tiddlers/SampleJavaScriptWithError.tid b/tw5.com/tiddlers/SampleJavaScriptWithError.tid
index 9153105c9..9d339cb7e 100644
--- a/tw5.com/tiddlers/SampleJavaScriptWithError.tid
+++ b/tw5.com/tiddlers/SampleJavaScriptWithError.tid
@@ -1,5 +1,6 @@
 title: SampleJavaScriptWithError
 type: application/javascript
+tags: demo
 
 /*
 This is an example JavaScript program that contains an error
diff --git a/tw5.com/tiddlers/SliderTests.tid b/tw5.com/tiddlers/SliderTests.tid
index ddb3bb485..15b0c9387 100644
--- a/tw5.com/tiddlers/SliderTests.tid
+++ b/tw5.com/tiddlers/SliderTests.tid
@@ -1,4 +1,5 @@
 title: SliderTests
+tags: demo
 
 The status of this slider is stored in the tiddler JackSlider:
 <>
diff --git a/tw5.com/tiddlers/Tiddler Fishes.svg.meta b/tw5.com/tiddlers/Tiddler Fishes.svg.meta
index 3d1342d79..257787b66 100644
--- a/tw5.com/tiddlers/Tiddler Fishes.svg.meta	
+++ b/tw5.com/tiddlers/Tiddler Fishes.svg.meta	
@@ -1,3 +1,3 @@
 title: Tiddler Fishes.svg
 type: image/svg+xml
-tags: Picture
+tags: picture
diff --git a/tw5.com/tiddlers/TiddlerFiles.tid b/tw5.com/tiddlers/TiddlerFiles.tid
index cc2a6eefe..7b6bd62e6 100644
--- a/tw5.com/tiddlers/TiddlerFiles.tid
+++ b/tw5.com/tiddlers/TiddlerFiles.tid
@@ -1,5 +1,6 @@
 title: TiddlerFiles
 modifier: JeremyRuston
+tags: internals
 
 Tiddlers can be stored in text files in several different formats. Files containing single tiddlers can also have an auxiliary `.meta` file formatted as a sequence of name:value pairs:
 {{{
diff --git a/tw5.com/tiddlers/TiddlerFilters.tid b/tw5.com/tiddlers/TiddlerFilters.tid
new file mode 100644
index 000000000..dc421e6cf
--- /dev/null
+++ b/tw5.com/tiddlers/TiddlerFilters.tid
@@ -0,0 +1,55 @@
+title: TiddlerFilters
+tags: feature
+
+TiddlyWiki has a special syntax for expressing filters. They can be used to select tiddlers for an operation, or to filter a set of tiddlers to add or remove members.
+
+The mechanism is easiest to understand by first presenting some example filter strings:
+
+|!Filter |!Results |
+|`HelloThere` |The single tiddler titled `HelloThere` (if it exists) |
+|`[[A Title With Several Words]]` |The single tiddler titled `A Title With Several Words` (if it exists) |
+|`[title[MyTiddler]]` |The single tiddler titled `MyTiddler` (if it exists) |
+|`HelloThere Introduction` |The tiddlers titled `HelloThere` and `Introduction` (if they exist) |
+|`[tag[important]]` |Any tiddlers with the tag `important` |
+|`[!tag[important]]` |Any tiddlers not with the tag `important` |
+|`[tag[important]sort[title]]` |Any tiddlers with the tag `important` sorted by title |
+|`[tag[important]!sort[title]]` |Any tiddlers with the tag `important` reverse sorted by title |
+|`[[one][two][three]tag[tom]]` |Any of the tiddlers called `one`, `two` or `three` that exist and are tagged with `tom` |
+|`[[one][two][three]] [tag[tom]]` |Any of the tiddlers called `one`, `two` or `three` that exist, along with all of the source tiddlers that are tagged with `tom` |
+|`[tag[tom]] [tag[harry]] -[[one][two][three]]` |All tiddlers tagged either `tom` or `harry`, but excluding `one`, `two` and `three` |
+
+[[one]] [[two]] [tag[three]] -[[four]] +[sort[title]]
+[tag[important]] -[[one][two]] -[[three]] +[sort[-modified]limit[20]]
+
+A filter string consists of one or more filter operations, each comprising one or more filter operators with associated operands.
+
+The operators look like `[operator[operand]]`, where `operator` is one of:
+* ''title'': selects the tiddler with the title given in the operand
+* ''is'': tests whether a tiddler is a member of the system defined set named in the operand (see below)
+* ''has'': tests whether a tiddler has a specified field
+* ''sort'': sorts the tiddlers by a given field
+* ''limit'': limits the number of subresults
+* ''tag'': tests whether a given tag is (`[tag[mytag]]`) or is not (`[!tag[mytag]]`) present on the tiddler
+* '''': tests whether a tiddler field has a specified value (`[modifier[Jeremy]]`) or not (`[!modifier[Jeremy]]`)
+
+An operator can be negated with by preceding it with `!`, for example `[!tag[Tommy]]` selects the tiddlers that are not tagged with `Tommy`.
+
+The operator defaults to `title` if omitted, so `[[HelloThere]]` is equivalent to `[title[HelloThere]]`. If there are no spaces in the title, then the double square brackets can also be omitted: `HelloThere`.
+
+The operands available with the `is` operator are:
+* ''tiddler'': selects all ordinary (non-shadow) tiddlers
+
+Operators are combined into logically ANDed expressions by bashing them together and merging the square brackets:
+{{{
+[tag[one]] [tag[two]] ---> [tag[one]tag[two]]
+}}}
+
+Operations can be preceded with `-` to negate their action, removing the selected tiddlers from the results. For example, `[tag[Tommy]] -HelloThere -[[Another One]]` selects all tiddlers tagged with `Tommy` except those titled `HelloThere` or `Another One`.
+
+Operations can be preceded with `+` in order to make them apply to all of the current results, rather than the original source. For example, `[tag[Jeremy]] [tag[Tommy]] +[sort[title]]` selects the tiddlers tagged `Tommy` or `Jeremy`, and sorts them by the `title` field.
+
+Filters are processed with the following elements:
+* a string of filter operations, each made up of one or more filter operators
+* the incoming source tiddlers
+* the overall result stack
+* the subresult stack of the tiddlers selected by the current operation
diff --git a/tw5.com/tiddlers/TiddlyWiki.tid b/tw5.com/tiddlers/TiddlyWiki.tid
index 583c3ad86..e5994706e 100644
--- a/tw5.com/tiddlers/TiddlyWiki.tid
+++ b/tw5.com/tiddlers/TiddlyWiki.tid
@@ -1,6 +1,7 @@
 title: TiddlyWiki
 modifier: JeremyRuston
 modified: 20120211110622
+tag: introduction
 
 TiddlyWiki is a rich, interactive interface for manipulating complex data with structure that doesn't easily fit into conventional tools like spreadsheets or wordprocessors.
 
diff --git a/tw5.com/tiddlers/TiddlyWikiArchitecture.tid b/tw5.com/tiddlers/TiddlyWikiArchitecture.tid
index 572d7f8f9..4cd4bd87a 100644
--- a/tw5.com/tiddlers/TiddlyWikiArchitecture.tid
+++ b/tw5.com/tiddlers/TiddlyWikiArchitecture.tid
@@ -1,5 +1,6 @@
 title: TiddlyWikiArchitecture
 modifier: JeremyRuston
+tags: internals
 
 !! Overview
 
diff --git a/tw5.com/tiddlers/TryingOutTiddlyWiki.tid b/tw5.com/tiddlers/TryingOutTiddlyWiki.tid
index 69ce1437e..142a823c8 100644
--- a/tw5.com/tiddlers/TryingOutTiddlyWiki.tid
+++ b/tw5.com/tiddlers/TryingOutTiddlyWiki.tid
@@ -1,4 +1,5 @@
 title: TryingOutTiddlyWiki
+tags: introduction
 
 For trying TiddlyWiki5 out under node.js, two batch files are provided:
 
diff --git a/tw5.com/tiddlers/TypedBlockTests.tid b/tw5.com/tiddlers/TypedBlockTests.tid
index 69e55be79..de718b2a1 100644
--- a/tw5.com/tiddlers/TypedBlockTests.tid
+++ b/tw5.com/tiddlers/TypedBlockTests.tid
@@ -1,4 +1,5 @@
 title: TypedBlockTests
+tags: demo
 
 WikiText can include blocks of text that are rendered with an explicit MIME type like this:
 {{{
diff --git a/tw5.com/tiddlers/VideoTests.tid b/tw5.com/tiddlers/VideoTests.tid
index ba2d012ab..adde8b506 100644
--- a/tw5.com/tiddlers/VideoTests.tid
+++ b/tw5.com/tiddlers/VideoTests.tid
@@ -1,4 +1,5 @@
 title: VideoTests
+tags: demo
 
 Here is a collection of embedded videos. Try opening and closing tiddlers while the videos are playing; they should not be affected.
 
diff --git a/tw5.com/tiddlers/View Switcher Sketch.jpg.meta b/tw5.com/tiddlers/View Switcher Sketch.jpg.meta
index 471775d54..ba01145b0 100644
--- a/tw5.com/tiddlers/View Switcher Sketch.jpg.meta	
+++ b/tw5.com/tiddlers/View Switcher Sketch.jpg.meta	
@@ -1,4 +1,4 @@
 title: View Switcher Sketch.jpg
 modifier: JeremyRuston
 type: image/jpeg
-tags: Picture
+tags: picture
diff --git a/tw5.com/tiddlers/WaysToUseTiddlyWiki.tid b/tw5.com/tiddlers/WaysToUseTiddlyWiki.tid
index fc68a0ef7..2607d8ffe 100644
--- a/tw5.com/tiddlers/WaysToUseTiddlyWiki.tid
+++ b/tw5.com/tiddlers/WaysToUseTiddlyWiki.tid
@@ -1,4 +1,5 @@
 title: WaysToUseTiddlyWiki
+tags: feature
 
 !Introduction
 TiddlyWiki5 will be deployable in a wide variety of different arrangements to suit different needs. The archetypal configurations are listed below along with a measure of how much complexity is involved in setting up each one -- once set up properly, the TiddlyWiki user experience should be consistent regardless of configuration.