From 35b99dcceeb8ed47b7a63540b4eb50fc848f4ce7 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Mon, 12 Jan 2015 20:01:24 +0000 Subject: [PATCH 01/10] Correct typo in sample tag name --- editions/tw5.com/tiddlers/filters/Introduction to Filters.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/filters/Introduction to Filters.tid b/editions/tw5.com/tiddlers/filters/Introduction to Filters.tid index 49c8fea04..8492d5e8a 100644 --- a/editions/tw5.com/tiddlers/filters/Introduction to Filters.tid +++ b/editions/tw5.com/tiddlers/filters/Introduction to Filters.tid @@ -78,7 +78,7 @@ A <> of runs will select the tiddlers that match <> If we want to ignore vegetarian recipes that serve 4, we can say this: ``` -[serving[3]] [serving[4]!tag[vegetarian]] [serving[5]] +[serving[3]] [serving[4]!tag[Vegetarian]] [serving[5]] ``` By default, each run considers every tiddler in the wiki. But we can use a `+` sign to force a run to consider only the tiddlers that were selected by the preceding runs: From 8fc404bbcab061abe371e7416a373d4d63c475ca Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Wed, 14 Jan 2015 21:27:07 +0000 Subject: [PATCH 02/10] Make filter syntax explanations accurate --- .../tw5.com/tiddlers/concepts/Filters.tid | 2 +- .../tw5.com/tiddlers/filters/FilterSyntax.tid | 48 ++++++++++--------- .../filters/Introduction to Filters.tid | 2 +- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/editions/tw5.com/tiddlers/concepts/Filters.tid b/editions/tw5.com/tiddlers/concepts/Filters.tid index ec055933c..a380c49b9 100644 --- a/editions/tw5.com/tiddlers/concepts/Filters.tid +++ b/editions/tw5.com/tiddlers/concepts/Filters.tid @@ -5,7 +5,7 @@ title: Filters type: text/vnd.tiddlywiki list: [[Introduction to filter notation]] [[Filter Syntax]] -You can think of TiddlyWiki as a database where the records are tiddlers. A database typically provides a way of discovering which records match a given pattern, and in ~TiddlyWiki this is done with filters. +You can think of TiddlyWiki as a database in which the records are tiddlers. A database typically provides a way of discovering which records match a given pattern, and in ~TiddlyWiki this is done with filters. A <> is a concise notation for selecting a particular set of tiddlers, known as its <>. Whenever ~TiddlyWiki encounters a filter, it calculates the result. Further work can then be done with just those tiddlers, such as [[counting|CountWidget]] or [[listing|ListWidget]] them. diff --git a/editions/tw5.com/tiddlers/filters/FilterSyntax.tid b/editions/tw5.com/tiddlers/filters/FilterSyntax.tid index 5b98e011e..9919467fd 100644 --- a/editions/tw5.com/tiddlers/filters/FilterSyntax.tid +++ b/editions/tw5.com/tiddlers/filters/FilterSyntax.tid @@ -4,25 +4,33 @@ tags: Filters title: Filter Syntax type: text/vnd.tiddlywiki -[[Filters]] follow a grammar that is presented here, using [[RailroadDiagrams]], for those who find formal syntax descriptions helpful. However, [[you can learn to write filters|Introduction to filter notation]] without needing to understand this tiddler. +:([[Filters]] follow a grammar that is presented here, using [[RailroadDiagrams]], for those who find formal syntax descriptions helpful. However, [[you can learn to write filters|Introduction to filter notation]] without needing to understand this tiddler.) -When a filter is evaluated, it generates a <>, which is an ordered set of items. No item can appear more than once in the result. The items are usually tiddler titles, but certain specialised filters generate other items, such as Node.js command words. +A <> is an expression whose value is an ordered set of items known as its <>. No item can appear more than once in the result. The items are usually tiddler titles, but certain specialised filter steps produce other items, such as field names. + +A filter is a sequence of zero or more ''runs'', and each run is a sequence of one or more ''steps''. Each step and each run produces its own intermediate result. --- ;filter : <$railroad text=""" -{ [:whitespace] ("+" | :- | "-") run } +[{ : [:whitespace] ("+" | :- | "-") run }] """/> -A <> is a sequence of runs, evaluated from left to right. +A filter starts with an empty result. The runs are processed from left to right, progressively modifying the result. -Each run receives an <>, which it modifies to produce a result. The first run in a sequence receives `[all[tiddlers]]` as its input, i.e. the set of all non-missing tiddlers. The second run receives the result of the first run as its input, and so on. +Each run receives a <> set from which to select items. This is normally the set of all tiddlers in the wiki, in the order they happen to be stored there, but it can be changed by prefixing a run with `+`. + +* If the run has no `+` or `-` prefix, the items in its result are <> to the filter's result. If this leaves the filter's result containing two copies of the same item, the earlier one is removed. +* If the run has a `-` prefix, the items in its result are <> from the filter's result if they were present there. +* If the run has a `+` prefix, it receives the filter's current result as its source set. The filter's result is then completely <> by the run's result. Any subsequent run reverts to receiving all tiddlers as its source set, unless it too has a `+` prefix. + +In concise technical terms: |!Run |!Interpretation |!Result | -|`run` |union of sets|input OR run | -|`+run` |intersection of sets |input AND run | -|`-run` |difference of sets|input AND NOT run | +|`run` |union of sets|result OR run | +|`+run` |intersection of sets |result AND run | +|`-run` |difference of sets|result AND NOT run | --- @@ -31,23 +39,21 @@ Each run receives an <>, which it modifies to produce a res ( "[" {step} "]" | [:{/"anything but [ ] or whitespace"/}] -) -"""/> - - +) +"""/> -The lower option, e.g. matching `HelloThere`, is short for `[title[HelloThere]]`. +The steps of a run are processed from left to right. Each step receives a source set. For the first step, this is the run's source set. For each subsequent step, the source is the result of the previous step. -A <> is a sequence of steps, evaluated from left to right. +The result of a run depends on the operator involved: -The run's result is basically the intersection of the step results. In other words, the run's result contains the items that are found in <> of the step results. +* Most operators are <>. They examine each item in their source set and discard any that don't match. Such steps serve to narrow down the result of their run. +* A few operators, called <>, ignore the source they're given and generate an independent result instead. `title` is a good example. The result of `[title[A]title[B]]` is `B`. But `field` is a filterer, so the result of `[title[A]field:title[B]` is empty. -However, a few operators (known as <>) ignore any preceding steps in the same run, and completely replace the result so far. Examples of this are <> and <>, but not <>. +The lower three options in the diagram match items like `HelloThere`, `"HelloThere"` and `'HelloThere'`, and are short for `[title[HelloThere]]`. The two quoted options exist to support titles that contain square brackets, such as `"An [[[[Unusual]]]] Tiddler"`. --- @@ -56,7 +62,7 @@ However, a few operators (known as <>) ignore any preceding s [:"!"] [:method] parameter """/> -If the method is omitted, it defaults to `title`. +If a step's method is omitted, it defaults to `title`. --- @@ -65,12 +71,10 @@ If the method is omitted, it defaults to `title`. operator [:":" suffix] """/> -The operator is drawn from a list of [[predefined names|FilterOperators]]. +The operator is drawn from a list of [[predefined names|FilterOperators]]. If it can't be found in that list, it is instead treated as the suffix to the <> operator. The suffix is additional information, usually the name of a [[field|TiddlerFields]], that extends the meaning of certain operators. -An unrecognised operator name is is treated as the suffix to the <> operator. - --- ;parameter diff --git a/editions/tw5.com/tiddlers/filters/Introduction to Filters.tid b/editions/tw5.com/tiddlers/filters/Introduction to Filters.tid index 8492d5e8a..2ebc691b9 100644 --- a/editions/tw5.com/tiddlers/filters/Introduction to Filters.tid +++ b/editions/tw5.com/tiddlers/filters/Introduction to Filters.tid @@ -4,7 +4,7 @@ tags: Learning Filters title: Introduction to filter notation type: text/vnd.tiddlywiki -: (This explains the basics of writing a [[filter|Filters]] to select a set of tiddlers. For a more technical summary, see [[Filter Syntax]].) +:(This explains the basics of writing a [[filter|Filters]] to select a set of tiddlers. For a more technical summary, see [[Filter Syntax]].) The simplest case is where you already know exactly which tiddlers you want. Type each title in double square brackets, with a space or linebreak between each one and the next: From 172c7ef7ddc6ccdc78f1fa37bd82660f60e8b253 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Sun, 18 Jan 2015 18:39:00 +0000 Subject: [PATCH 03/10] Overhaul the filter operator documentation: part 1 --- .../tw5.com/tiddlers/commands/Commands.tid | 6 +- .../tiddlers/concepts/AbsoluteOperators.tid | 11 + .../tw5.com/tiddlers/concepts/DateFields.tid | 28 +++ .../tiddlers/concepts/DominantAppend.tid | 11 + .../tiddlers/concepts/FilterParameters.tid | 20 ++ .../tw5.com/tiddlers/concepts/Filters.tid | 12 +- .../tiddlers/concepts/ObservableLinks.tid | 20 ++ .../tw5.com/tiddlers/concepts/TiddlerSets.tid | 10 + .../tw5.com/tiddlers/concepts/TitleList.tid | 10 +- .../tw5.com/tiddlers/fields/ListField.tid | 5 +- .../filters/FilterOperator addprefix.tid | 23 ++- .../filters/FilterOperator addsuffix.tid | 23 ++- .../tiddlers/filters/FilterOperator after.tid | 29 ++- .../tiddlers/filters/FilterOperator all.tid | 41 ++-- .../filters/FilterOperator backlinks.tid | 23 ++- .../filters/FilterOperator before.tid | 27 ++- .../tiddlers/filters/FilterOperator bf.tid | 11 +- .../filters/FilterOperator butfirst.tid | 11 +- .../filters/FilterOperator butlast.tid | 22 +- .../filters/FilterOperator commands.tid | 20 +- .../tiddlers/filters/FilterOperator each.tid | 35 ++-- .../filters/FilterOperator eachday.tid | 29 ++- .../FilterOperator editiondescription.tid | 17 +- .../filters/FilterOperator editions.tid | 17 +- .../tiddlers/filters/FilterOperator field.tid | 32 ++- .../filters/FilterOperator fields.tid | 20 +- .../tiddlers/filters/FilterOperator first.tid | 22 +- .../tiddlers/filters/FilterOperator get.tid | 23 ++- .../tiddlers/filters/FilterOperator has.tid | 27 ++- .../tiddlers/filters/FilterOperator is.tid | 4 +- .../filters/FilterOperator modules.tid | 2 +- .../tiddlers/filters/FilterOperators.tid | 29 ++- .../tw5.com/tiddlers/filters/FilterSyntax.tid | 58 +++--- .../filters/Introduction to Filters.tid | 36 ++-- .../filters/dummies/Days of the Week.tid | 11 + .../tiddlers/filters/dummies/Friday.tid | 6 + .../tiddlers/filters/dummies/Monday.tid | 6 + .../tiddlers/filters/dummies/Saturday.tid | 6 + .../tiddlers/filters/dummies/Sunday.tid | 6 + .../tiddlers/filters/dummies/Thursday.tid | 13 ++ .../tiddlers/filters/dummies/Tuesday.tid | 6 + .../tiddlers/filters/dummies/Wednesday.tid | 6 + .../tiddlers/filters/examples/addprefix.tid | 7 + .../tiddlers/filters/examples/addsuffix.tid | 7 + .../tiddlers/filters/examples/after.tid | 10 + .../tw5.com/tiddlers/filters/examples/all.tid | 14 ++ .../tiddlers/filters/examples/backlinks.tid | 9 + .../tiddlers/filters/examples/before.tid | 10 + .../tiddlers/filters/examples/butlast.tid | 11 + .../tiddlers/filters/examples/commands.tid | 7 + .../tiddlers/filters/examples/each.tid | 10 + .../tiddlers/filters/examples/eachday.tid | 9 + .../tiddlers/filters/examples/field.tid | 8 + .../tiddlers/filters/examples/fields.tid | 8 + .../tiddlers/filters/examples/first.tid | 11 + .../tw5.com/tiddlers/filters/examples/get.tid | 8 + .../tw5.com/tiddlers/filters/examples/has.tid | 9 + editions/tw5.com/tiddlers/howtos/Tagging.tid | 4 +- .../tiddlers/releasenotes/Release 5.1.3.tid | 6 +- .../tiddlers/releasenotes/Release 5.1.5.tid | 4 +- .../tiddlers/releasenotes/Release 5.1.6.tid | 4 +- .../releasenotes/beta/Release 5.0.10beta.tid | 4 +- .../releasenotes/beta/Release 5.0.11beta.tid | 6 +- .../releasenotes/beta/Release 5.0.13beta.tid | 4 +- .../releasenotes/beta/Release 5.0.16beta.tid | 6 +- .../releasenotes/beta/Release 5.0.17beta.tid | 4 +- .../styleguide/Documentation Macros.tid | 191 +++++++++--------- .../styleguide/Documentation Style Guide.tid | 4 +- .../styleguide/Instruction Tiddlers.tid | 10 +- .../styleguide/Reference Tiddlers.tid | 12 +- .../tw5.com/tiddlers/styleguide/Spelling.tid | 5 +- .../styleguide/Technical Prose Style.tid | 5 +- .../tiddlers/styleguide/Tiddler Structure.tid | 1 + .../styleguide/Tiddler Title Policy.tid | 20 +- .../tiddlers/styleguide/Typography.tid | 3 +- .../tw5.com/tiddlers/system/doc-macros.tid | 66 +++--- .../tw5.com/tiddlers/system/doc-styles.tid | 50 ++++- .../tiddlers/system/operator-macros.tid | 60 ++++++ .../tiddlers/system/wikitext-macros.tid | 16 +- .../wikitext/Variables in WikiText.tid | 6 +- 80 files changed, 941 insertions(+), 462 deletions(-) create mode 100644 editions/tw5.com/tiddlers/concepts/AbsoluteOperators.tid create mode 100644 editions/tw5.com/tiddlers/concepts/DateFields.tid create mode 100644 editions/tw5.com/tiddlers/concepts/DominantAppend.tid create mode 100644 editions/tw5.com/tiddlers/concepts/FilterParameters.tid create mode 100644 editions/tw5.com/tiddlers/concepts/ObservableLinks.tid create mode 100644 editions/tw5.com/tiddlers/concepts/TiddlerSets.tid create mode 100644 editions/tw5.com/tiddlers/filters/dummies/Days of the Week.tid create mode 100644 editions/tw5.com/tiddlers/filters/dummies/Friday.tid create mode 100644 editions/tw5.com/tiddlers/filters/dummies/Monday.tid create mode 100644 editions/tw5.com/tiddlers/filters/dummies/Saturday.tid create mode 100644 editions/tw5.com/tiddlers/filters/dummies/Sunday.tid create mode 100644 editions/tw5.com/tiddlers/filters/dummies/Thursday.tid create mode 100644 editions/tw5.com/tiddlers/filters/dummies/Tuesday.tid create mode 100644 editions/tw5.com/tiddlers/filters/dummies/Wednesday.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/addprefix.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/addsuffix.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/after.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/all.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/backlinks.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/before.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/butlast.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/commands.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/each.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/eachday.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/field.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/fields.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/first.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/get.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/has.tid create mode 100644 editions/tw5.com/tiddlers/system/operator-macros.tid diff --git a/editions/tw5.com/tiddlers/commands/Commands.tid b/editions/tw5.com/tiddlers/commands/Commands.tid index 4d79cb88e..fc95297db 100644 --- a/editions/tw5.com/tiddlers/commands/Commands.tid +++ b/editions/tw5.com/tiddlers/commands/Commands.tid @@ -1,6 +1,8 @@ +created: 20150117174359000 +modified: 20150117205257000 title: Commands -tags: Reference +tags: Concepts Reference -Commands are used with [[TiddlyWiki on Node.js|Using TiddlyWiki on Node.js]]. +A <<.def command>> is one of the following words, written with a `--` prefix and used as a command-line option to [[TiddlyWiki on Node.js]], indicating which action is desired. <> diff --git a/editions/tw5.com/tiddlers/concepts/AbsoluteOperators.tid b/editions/tw5.com/tiddlers/concepts/AbsoluteOperators.tid new file mode 100644 index 000000000..4c097d8f4 --- /dev/null +++ b/editions/tw5.com/tiddlers/concepts/AbsoluteOperators.tid @@ -0,0 +1,11 @@ +created: 20150117204109000 +modified: 20150117204242000 +tags: Concepts +title: Absolute Operators +type: text/vnd.tiddlywiki + +The output of a filter step depends on its [[operator|Filter Operators]]: + +* Most operators perform <<.def relative>> to their input. They examine each input string in turn and filter out any that don't match. Such steps narrow down the output of a run. + +* <<.def Absolute>> operators ignore their input and generate an independent output instead. <<.olink title>> is an example: the result of `[title[A]title[B]]` is `B`. But the <<.olink field>> operator is relative, so the result of `[title[A]field:title[B]` is empty. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/concepts/DateFields.tid b/editions/tw5.com/tiddlers/concepts/DateFields.tid new file mode 100644 index 000000000..33eb37cb9 --- /dev/null +++ b/editions/tw5.com/tiddlers/concepts/DateFields.tid @@ -0,0 +1,28 @@ +created: 20150117190213631 +modified: 20150117191804000 +tags: Concepts +title: Date Fields +type: text/vnd.tiddlywiki + +Certain [[fields|TiddlerFields]] of a tiddler are used to store dates and times. + +The two standard date fields are <<.field created>> and <<.field modified>>. + +Values of date fields are 17-character strings: + +* 4 digits for the year +* 2 digits for the month +* 2 digits for the day +* 2 digits for the hour +* 2 digits for the minute +* 2 digits for the second +* 3 digits for the millisecond + +To avoid problems arising from differences of time zone, TiddlyWiki always uses [[UTC|http://en.wikipedia.org/wiki/Coordinated_Universal_Time]]. + +As an example, the <<.field created>> field of this tiddler has the value <<.value """<$view field="created"/>""">>. + +Dates can be [[converted to other formats|DateFormat]] for display: + +<$macrocall $name="wikitext-example-without-html" +src="""<$view field="created" format="date" template="DDD DDth MMM YYYY"/>"""> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/concepts/DominantAppend.tid b/editions/tw5.com/tiddlers/concepts/DominantAppend.tid new file mode 100644 index 000000000..4b4bb9e3b --- /dev/null +++ b/editions/tw5.com/tiddlers/concepts/DominantAppend.tid @@ -0,0 +1,11 @@ +created: 20151714300000000 +modified: 20150117172438000 +tags: Concepts +title: Dominant Append +type: text/vnd.tiddlywiki + +A <<.def "dominant append">> is a frequent occurrence in [[filter|Filters]] processing. + +Filters manipulate sets of items in which no item can appear more than once, and they often append one such set to another. + +This is done in such a way that if the result would contain two copies of the same item, the <<.em earlier>> one is removed. The appended items thus dominate over any earlier duplicates. diff --git a/editions/tw5.com/tiddlers/concepts/FilterParameters.tid b/editions/tw5.com/tiddlers/concepts/FilterParameters.tid new file mode 100644 index 000000000..f6e08ef4b --- /dev/null +++ b/editions/tw5.com/tiddlers/concepts/FilterParameters.tid @@ -0,0 +1,20 @@ +created: 20151714300000000 +modified: 20150117193508000 +tags: Concepts +title: Filter Parameters +type: text/vnd.tiddlywiki + +The parameter to a [[filter operator|Filter Operators]] can be: + +;<<.def direct>> +: `[like this]` +: Literal, treated at face value +;<<.def indirect>> +:<<.def transcluded>> +:: `{like this}` +:: The value of a field of a specified tiddler, or the value of an index of a specified [[data tiddler|DataTiddlers]] +:<<.def variable>> +::`` +:: The value of the specified [[variable|Variables]] + +See [[Filter Syntax]]. diff --git a/editions/tw5.com/tiddlers/concepts/Filters.tid b/editions/tw5.com/tiddlers/concepts/Filters.tid index a380c49b9..988ad840d 100644 --- a/editions/tw5.com/tiddlers/concepts/Filters.tid +++ b/editions/tw5.com/tiddlers/concepts/Filters.tid @@ -1,5 +1,5 @@ -created: 20130827080000000= -modified: 20140912145347313 +created: 20130827080000000 +modified: 20150117193502000 tags: Reference Concepts title: Filters type: text/vnd.tiddlywiki @@ -7,7 +7,7 @@ list: [[Introduction to filter notation]] [[Filter Syntax]] You can think of TiddlyWiki as a database in which the records are tiddlers. A database typically provides a way of discovering which records match a given pattern, and in ~TiddlyWiki this is done with filters. -A <> is a concise notation for selecting a particular set of tiddlers, known as its <>. Whenever ~TiddlyWiki encounters a filter, it calculates the result. Further work can then be done with just those tiddlers, such as [[counting|CountWidget]] or [[listing|ListWidget]] them. +A <<.def filter>> is a concise notation for selecting a particular [[set of tiddlers|Tiddler Sets]], known as its <<.def "output">>. Whenever ~TiddlyWiki encounters a filter, it calculates the output. Further work can then be done with just those tiddlers, such as [[counting|CountWidget]] or [[listing|ListWidget]] them. The following example passes a filter to the [[list-links macro|ListMacro]] to display a list of all tiddlers whose titles start with the letter H: @@ -15,11 +15,11 @@ The following example passes a filter to the [[list-links macro|ListMacro]] to d <> ``` -The result of a filter can change as tiddlers are added and deleted in the wiki. ~TiddlyWiki recalculates the results on the fly, automatically updating any filter-based counts or lists as well. +A filter's output can change as tiddlers are added and deleted in the wiki. ~TiddlyWiki recalculates on the fly, automatically updating any filter-based counts or lists as well. -[[Advanced Search|$:/AdvancedSearch]] has a <> tab that makes it easy to experiment with filters. +[[Advanced Search|$:/AdvancedSearch]] has a <<.advancedsearch-tab Filter>> tab that makes it easy to experiment with filters. ;Find out more: * [[Introduction to filter notation]] -- a step-by-step walkthrough * [[Filter Syntax]] -- the exact rules of the notation -* [[FilterOperators]] -- the available methods of filtering \ No newline at end of file +* [[Filter Operators]] -- the available methods of filtering diff --git a/editions/tw5.com/tiddlers/concepts/ObservableLinks.tid b/editions/tw5.com/tiddlers/concepts/ObservableLinks.tid new file mode 100644 index 000000000..076deeb2d --- /dev/null +++ b/editions/tw5.com/tiddlers/concepts/ObservableLinks.tid @@ -0,0 +1,20 @@ +created: 20130825202900000 +modified: 20150117152438000 +tags: Concepts +title: Observable Links +type: text/vnd.tiddlywiki + +An <<.def "observable link">> is a [[link|TiddlerLinks]] whose presence can be detected by a superficial examination of WikiText. + +A link is <<.em not>> observable if it is: + +* contained in text [[transcluded|Transclusion]] from elsewhere +* supplied via [[Macros]] or [[Variables]] +* generated by a <<.wlink LinkWidget>> widget whose `to` attribute is a transclusion, macro or variable + +Unobservable links are <<.em ignored>> by the link-related [[Filter Operators]]: + +* <<.olink backlinks>> +* <<.olink links>> +* <<.olink2 "all[missing]" all>> +* <<.olink2 "all[orphans]" all>> diff --git a/editions/tw5.com/tiddlers/concepts/TiddlerSets.tid b/editions/tw5.com/tiddlers/concepts/TiddlerSets.tid new file mode 100644 index 000000000..bac6c370f --- /dev/null +++ b/editions/tw5.com/tiddlers/concepts/TiddlerSets.tid @@ -0,0 +1,10 @@ +created: 20150117152418000 +modified: 20150117165517000 +tags: Concepts +title: Tiddler Sets + +A <<.def "tiddler set">> is a data structure. It is an ordered collection of strings, usually tiddler titles, containing no duplicates. + +Tiddler sets are important in [[filter|Filters]] processing. + +The simplest way to generate one is to use the TitleList syntax. diff --git a/editions/tw5.com/tiddlers/concepts/TitleList.tid b/editions/tw5.com/tiddlers/concepts/TitleList.tid index 72d06900d..7c595da47 100644 --- a/editions/tw5.com/tiddlers/concepts/TitleList.tid +++ b/editions/tw5.com/tiddlers/concepts/TitleList.tid @@ -1,12 +1,14 @@ +created: 20150117152418000 +modified: 20150117163928000 tags: Concepts title: TitleList -A title list is a line of text that presents one or more tiddler titles, strung together with a space between each one and the next. +A <<.def "title list">> is a line of text that presents one or more tiddler titles, strung together with a space between each one and the next. -If a title //contains// a space, it needs double square brackets around it. - -Example: +If a title <<.em contains>> a space, it needs double square brackets around it: `GettingStarted [[Discover TiddlyWiki]] Upgrading` Title lists are used in various places, including PermaLinks and the ListField. + +They are in fact the simplest case of a [[filter|Filters]]. diff --git a/editions/tw5.com/tiddlers/fields/ListField.tid b/editions/tw5.com/tiddlers/fields/ListField.tid index 43d4a6d76..511f83e0a 100644 --- a/editions/tw5.com/tiddlers/fields/ListField.tid +++ b/editions/tw5.com/tiddlers/fields/ListField.tid @@ -1,10 +1,11 @@ created: 20130830092500000 -modified: 20140919155816993 +modified: 20150117163423000 tags: Fields title: ListField +caption: list type: text/vnd.tiddlywiki -The `list` [[field of a tiddler|TiddlerFields]] is an optional feature that can be used to help structure your content. It is defined as an ordered sequence of tiddler titles, and it can be used in several ways: +The `list` [[field of a tiddler|TiddlerFields]] is an optional feature that can be used to help structure your content. It is defined as an [[ordered sequence of tiddler titles|TitleList]], and it can be used in several ways: * The `list` field of a tiddler that is being used as a tag determines the ordering of the tiddlers that carry that tag - see [[Tagging]] for details * The `list` [[filter|Filters]] selects the entries from a list diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator addprefix.tid b/editions/tw5.com/tiddlers/filters/FilterOperator addprefix.tid index 48ac8129d..5b692b951 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator addprefix.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator addprefix.tid @@ -1,15 +1,16 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: addprefix -title: FilterOperator: addprefix +modified: 20150118182915000 +tags: [[Filter Operators]] [[String Operators]] +title: addprefix Operator type: text/vnd.tiddlywiki +caption: addprefix +purpose: extend each input item with a prefix -The ''addprefix'' filter operator add a prefix to all titles in the current list. +<<.operator-def +input:"a [[set|Tiddler Sets]] of strings" +parameter:"a prefix to be added" +paramName:"p" +output:"a copy of the input, but with the prefix added to the start of each string" +>> -For example: - -|!Filter String |!Description | -|`one two three +[addprefix[tid-]]` |Returns `tid-one`, `tid-two`, `tid-three` | - -See also [[FilterOperator: prefix]], [[FilterOperator: suffix]], [[FilterOperator: addsuffix]], [[FilterOperator: removeprefix]] and [[FilterOperator: removesuffix]]. +<<.operator-examples "addprefix">> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator addsuffix.tid b/editions/tw5.com/tiddlers/filters/FilterOperator addsuffix.tid index ecd3748b7..24a11c26b 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator addsuffix.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator addsuffix.tid @@ -1,15 +1,16 @@ created: 20140828133830424 -modified: 20140902145613329 -tags: Filters -caption: addsuffix -title: FilterOperator: addsuffix +modified: 20150118182957000 +tags: [[Filter Operators]] [[String Operators]] +title: addsuffix Operator type: text/vnd.tiddlywiki +caption: addsuffix +purpose: extend each input item with a suffix -The ''addsuffix'' filter operator adds a suffix to all titles in the current list. +<<.operator-def +input:"a [[set|Tiddler Sets]] of strings" +parameter:"a suffix to be added" +paramName:"p" +output:"a copy of the input, but with the suffix added to the end of each string" +>> -For example: - -|!Filter String |!Description | -|`one two three +[addsuffix[-tid]]` |Returns `one-tid`, `two-tid`, `three-tid` | - -See also [[FilterOperator: suffix]], [[FilterOperator: prefix]], [[FilterOperator: addprefix]], [[FilterOperator: removesuffix]], and [[FilterOperator: removeprefix]]. +<<.operator-examples "addsuffix">> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator after.tid b/editions/tw5.com/tiddlers/filters/FilterOperator after.tid index 76b37debb..0ac8a6a42 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator after.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator after.tid @@ -1,21 +1,18 @@ created: 20140512103123179 -modified: 20140512103123179 -tags: Filters -title: FilterOperator: after -caption: after +modified: 20150118183000000 +tags: [[Filter Operators]] [[List Operators]] +title: after Operator type: text/vnd.tiddlywiki +caption: after +purpose: get the successor of an input item -The ''after'' filter operator returns the tiddler from the current list that is after the tiddler named in the operand. +<$macrocall $name=".operator-def" +input="a [[set|Tiddler Sets]] of strings" +parameter="one of those strings" +paramName="p" +output="the string that immediately follows <<.place p>> in the input set" +/> -The following examples assume a tiddler called `MyList` with a `list` field containing: +If <<.place p>> is not present in the input set, or is the last item, then the output is empty. -``` -one two three four five -``` - -|!Filter String |!Description | -|`[list[MyList]after[two]]` |Returns `three` | -|`[list[MyList]after[five]]` |Returns an empty list | -|`[list[MyList]after{!!title}]` |Returns `five` if the current tiddler is `four` | - -See also [[FilterOperator: before]], [[FilterOperator: previous]] and [[FilterOperator: next]]. +<<.operator-examples "after">> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator all.tid b/editions/tw5.com/tiddlers/filters/FilterOperator all.tid index b1781aede..327e179eb 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator all.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator all.tid @@ -1,22 +1,33 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters CommonFilters -title: FilterOperator: all -caption: all +modified: 20150118183004000 +tags: [[Filter Operators]] [[Common Operators]] [[Absolute Operators]] [[Link Operators]] +title: all Operator type: text/vnd.tiddlywiki +caption: all +purpose: get all tiddlers of a basic category -The ''all'' filter operator is used to select combinations of lists of tiddlers for subsequent operations. +<$macrocall $name=".operator-def" +input="ignored, unless <<.place p>> is empty" +parameter="see below" +paramName="p" +output="the [[set|Tiddler Sets]] of tiddler titles that belong to one or more basic categories" +/> -The operand of the ''all'' operator is a list of names of tiddler sources joined with `+`. +The parameter specifies categories using the following syntax: -For example: +<$railroad text=""" +[{: ("current" | "missing" |: "orphans" | "shadows" | "tiddlers" ) +"+" }] +"""/> -|!Filter String |!Description | -|`[all[tiddlers]]` |Selects all 'real' tiddlers (both system and non-system), excluding shadow tiddlers | -|`[all[shadows]]` |Selects all ShadowTiddlers, including those that have been overridden with real tiddlers | -|`[all[shadows+tiddlers]]` |Selects all ShadowTiddlers and all 'real' tiddlers together | -|`[all[current]]` |Selects the current tiddler | -|`[all[missing]]` |Selects all MissingTiddlers | -|`[all[orphans]]` |Selects all OrphanTiddlers | -|`[all[]]` |Selects all the source tiddlers available to the filter | +|!Category |!Members |!Sorted | +|^`current`|just the [[current tiddler|CurrentTiddler]]|^--| +|^`missing`|all non-existent tiddlers to which there is at least one [[observable link|Observable Links]]|^no| +|^`orphans`|all tiddlers to which there are <<.em no>> observable links|^by title| +|^`shadows`|all the [[shadow tiddlers|ShadowTiddlers]] that exist, including any that have been overridden with non-shadow tiddlers|^no| +|^`tiddlers`|all the non-shadow tiddlers that exist|no| +If the parameter specifies more than one category, they are processed from left to right. The overall output is initially empty, and each parameter's output is [[dominantly appended|Dominant Append]] to it in turn. + +As a special case, if there is no parameter, the output is simply a copy of the input. This can be useful when the parameter is [[supplied indirectly|Filter Parameters]]. + +<<.operator-examples "all">> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator backlinks.tid b/editions/tw5.com/tiddlers/filters/FilterOperator backlinks.tid index 39141fc06..7e47e73ef 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator backlinks.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator backlinks.tid @@ -1,16 +1,17 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: backlinks -title: FilterOperator: backlinks +modified: 20150118183008000 +tags: [[Filter Operators]] [[Link Operators]] +title: backlinks Operator type: text/vnd.tiddlywiki +caption: backlinks +purpose: get the tiddlers that link to each input tiddler -The ''backlinks'' filter operator replaces the current list with a list of the non-system tiddlers that link to them. +<$macrocall $name=".operator-def" +input="a [[set|Tiddler Sets]] of tiddler titles" +parameter="none" +output="the titles of any non-system tiddlers that contain [[Observable Links]] to the input tiddlers" +/> -For example: - -|!Filter String |!Description | -|`[[HelloThere]backlinks[]]` |Selects all tiddlers that contain links to the tiddler `HelloThere` | -|`[tag[Personal]backlinks[]]` |Selects all tiddlers that contain links to tiddlers tagged `Personal` | -|`[all[current]backlinks[]]` |Selects all tiddlers that contain links to the current tiddler | +Each input tiddler is processed in turn. Its corresponding set of backlinks is generated, sorted by title, and then [[dominantly appended|Dominant Append]] to the operator's overall output. +<<.operator-examples "backlinks">> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator before.tid b/editions/tw5.com/tiddlers/filters/FilterOperator before.tid index aa6fc4888..5c8016779 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator before.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator before.tid @@ -1,21 +1,18 @@ created: 20140512103123179 -modified: 20140512103123179 -tags: Filters +modified: 20150118183011000 +tags: [[Filter Operators]] [[List Operators]] caption: before -title: FilterOperator: before +title: before Operator type: text/vnd.tiddlywiki +purpose: get the predecessor of an input item -The ''before'' filter operator returns the tiddler from the current list that is before the tiddler named in the operand. +<$macrocall $name=".operator-def" +input="a [[set|Tiddler Sets]] of strings" +parameter="one of those strings" +paramName="p" +output="the string that immediately precedes <<.place p>> in the input set" +/> -The following examples assume a tiddler called `MyList` with a `list` field containing: +If <<.place p>> is not present in the input set, or is the first item, then the output is empty. -``` -one two three four five -``` - -|!Filter String |!Description | -|`[list[MyList]before[two]]` |Returns `one` | -|`[list[MyList]before[one]]` |Returns an empty list | -|`[list[MyList]before{!!title}]` |Returns `three` if the current tiddler is `four` | - -See also [[FilterOperator: after]], [[FilterOperator: previous]] and [[FilterOperator: next]]. +<<.operator-examples "before">> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator bf.tid b/editions/tw5.com/tiddlers/filters/FilterOperator bf.tid index 17056f1b2..e2a40de87 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator bf.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator bf.tid @@ -1,8 +1,9 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: bf -title: FilterOperator: bf +modified: 20150118182927000 +tags: [[Filter Operators]] [[List Operators]] +title: bf Operator type: text/vnd.tiddlywiki +caption: bf +purpose: same as <<.op rest>> -The ''bf'' filter operator is a synonym for [[FilterOperator: rest]]. +<<.op bf>> is a synonym for <<.olink rest>>, also known as <<.olink butfirst>>. diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator butfirst.tid b/editions/tw5.com/tiddlers/filters/FilterOperator butfirst.tid index f4d356f1c..e4544fb01 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator butfirst.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator butfirst.tid @@ -1,8 +1,9 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: butfirst -title: FilterOperator: butfirst +modified: 20150118183016000 +tags: [[Filter Operators]] [[Sequence Operators]] +title: butfirst Operator type: text/vnd.tiddlywiki +caption: butfirst +purpose: same as <<.op rest>> -The ''butfirst'' filter operator is a synonym for [[FilterOperator: rest]]. +<<.op butfirst>> is a synonym for <<.olink rest>>, also known as <<.olink bf>>. diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator butlast.tid b/editions/tw5.com/tiddlers/filters/FilterOperator butlast.tid index 8e438c9b2..e4b297642 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator butlast.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator butlast.tid @@ -1,14 +1,16 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: butlast -title: FilterOperator: butlast +modified: 20150118183022000 +tags: [[Filter Operators]] [[Sequence Operators]] +title: butlast Operator type: text/vnd.tiddlywiki +caption: butlast +purpose: get all the but last <<.place n>> input items -Without an operand, the ''butlast'' filter operator returns all but the last entry in the current list. The optional operand specifies the number of entries to omit. +<$macrocall $name=".operator-def" +input="a [[set|Tiddler Sets]] of strings" +parameter="an integer, defaulting to 1" +paramName="n" +output="all but the last <<.place n>> strings from the input set" +/> -For example: - -|!Filter String |!Description | -|`one two three four five +[butlast[]]` |Returns `one`, `two`, `three`, `four` | -|`one two three four five +[butlast[2]]` |Returns `one`, `two`, `three` | +<<.operator-examples "butlast">> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator commands.tid b/editions/tw5.com/tiddlers/filters/FilterOperator commands.tid index cc40f17a1..ae55ecbbe 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator commands.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator commands.tid @@ -1,14 +1,16 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: commands -title: FilterOperator: commands +modified: 20150118183026000 +tags: [[Filter Operators]] [[Non-Tiddler Operators]] [[Absolute Operators]] +title: commands Operator type: text/vnd.tiddlywiki +caption: commands +purpose: get all the Node.js commands -The ''commands'' filter operator replaces the current list with a list of the available commands (see the HelpCommand for details). +<$macrocall $name=".operator-def" +input="ignored" +parameter="none" +output="the set of [[commands|Commands]] that can be given to [[TiddlyWiki on Node.js]]" +/> -For example: - -|!Filter String |!Description | -|`[commands[]]` |Returns a list of the available command names | +<<.operator-examples "commands">> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator each.tid b/editions/tw5.com/tiddlers/filters/FilterOperator each.tid index 0645a1946..2dc69b024 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator each.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator each.tid @@ -1,27 +1,18 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: each -title: FilterOperator: each +modified: 20150118183030000 +tags: [[Filter Operators]] [[Group Operators]] +title: each Operator type: text/vnd.tiddlywiki +caption: each +purpose: get one of each group of input tiddlers by field value -The ''each'' filter operator filters the current list to leave only the first tiddler with each distinct value for a specified field. +<$macrocall $name=".operator-def" +input="a [[set|Tiddler Sets]] of tiddler titles" +parameter="the name of a [[field|TiddlerFields]]" +paramName="f" +output="a set containing the first tiddler with each distinct value for field <<.place f>>" +/> -For example: +Each input tiddler is processed in turn. The value of field <<.place f>> in that tiddler is examined, and as long as the value has not been encountered before, the tiddler's title is appended to the output set. -|!Filter String |!Description | -|`[all[tiddlers]sort[title]each[type]]` |Returns a list of the first tiddler with each distinct ''type'' field | - -The ''each'' operator can be used to group tiddlers. For example, the following example creates a list of tiddlers split into types: - -<$list filter="[!is[system]has[type]!type[text/vnd.tiddlywiki]each[type]sort[type]]"> -
- -! <$view field="type"/> -<$list filter="[type{!!type}!is[system]sort[title]]"> -
-<$link to={{!!title}}><$view field="title"/> -
- -
- +<<.operator-examples "each">> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator eachday.tid b/editions/tw5.com/tiddlers/filters/FilterOperator eachday.tid index f5002b5b7..4800f8b07 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator eachday.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator eachday.tid @@ -1,21 +1,18 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: eachday -title: FilterOperator: eachday +modified: 20150118183035000 +tags: [[Filter Operators]] [[Group Operators]] +title: eachday Operator type: text/vnd.tiddlywiki +caption: eachday +purpose: get one of each group of input tiddlers by date -The ''eachday'' filter operator filters the current list to leave only the first tiddler that has a distinct value for a specified date field. +<$macrocall $name=".operator-def" +input="a [[set|Tiddler Sets]] of tiddler titles" +parameter="the name of a [[date field|DateFields]]" +paramName="f" +output="a set containing the first tiddler with each distinct value (ignoring time of day) for field <<.place f>>" +/> -For example: +Each input tiddler is processed in turn. The value of field <<.place f>> in that tiddler is examined, and as long as this indicates a day that has not been encountered before, the tiddler's title is appended to the output set. -|!Filter String |!Description | -|`[eachday[created]]` |Returns a list of the first tiddler created on each distinct day | - -The ''eachday'' operator can be used to group tiddlers. For example, the following wiki text creates a list of the number of tiddlers that were modified on each day: - -<$list filter="[!is[system]eachday[modified]!sort[modified]]"> - -<$view field="modified" format="date" template="DD MMM YYYY"/>: <$count filter="[sameday{!!modified}]"/> modifications - - +<<.operator-examples "eachday">> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator editiondescription.tid b/editions/tw5.com/tiddlers/filters/FilterOperator editiondescription.tid index 686de3d28..55c0c6d05 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator editiondescription.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator editiondescription.tid @@ -1,10 +1,15 @@ created: 20150111145738451 -modified: 20150111145738451 -tags: Filters -caption: editiondescription -title: FilterOperator: editiondescription +modified: 20150118183039000 +tags: [[Filter Operators]] [[Non-Tiddler Operators]] [[Node.js Operators]] +title: editiondescription Operator type: text/vnd.tiddlywiki +caption: editiondescription +purpose: get the descriptions of the input ~TiddlyWiki editions -The ''editiondescription'' filter operator returns a description string for each edition name in the current results. It is only available under Node.js. +<$macrocall $name=".operator-def" +input="a [[set|Tiddler Sets]] of ~TiddlyWiki edition names" +parameter="none" +output="the description string of each edition in the input" +/> -Also see [[FilterOperator: editions]]. +<<.node-only-operator>> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator editions.tid b/editions/tw5.com/tiddlers/filters/FilterOperator editions.tid index 5dfa3b7d0..455ea99be 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator editions.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator editions.tid @@ -1,8 +1,15 @@ created: 20150111145738451 -modified: 20150111145738451 -tags: Filters -caption: editions -title: FilterOperator: editions +modified: 20150118183042000 +tags: [[Filter Operators]] [[Non-Tiddler Operators]] [[Node.js Operators]] [[Absolute Operators]] +title: editions Operator type: text/vnd.tiddlywiki +caption: editions +purpose: get the names of all ~TiddlyWiki editions -The ''editions'' filter operator returns the names of all the available editions. It is only available under Node.js. +<$macrocall $name=".operator-def" +input="none" +parameter="none" +output="the name of each ~TiddlyWiki edition, in alphabetical order" +/> + +<<.node-only-operator>> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator field.tid b/editions/tw5.com/tiddlers/filters/FilterOperator field.tid index 3c80f59b9..8ac452321 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator field.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator field.tid @@ -1,16 +1,28 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters CommonFilters -caption: field -title: FilterOperator: field +modified: 20150118183046000 +tags: [[Filter Operators]] [[Common Operators]] [[Field Operators]] +title: field Operator type: text/vnd.tiddlywiki +caption: field +purpose: filter the input tiddlers by field value -The ''field'' filter operator filters the current list according to whether a field matches a specified value. +<$macrocall $name=".operator-def-suffix" +input="a [[set|Tiddler Sets]] of tiddler titles" +suffix="the name of a field" +suffixName="f" +parameter="a potential value for field <<.place f>>" +paramName="p" +output="the subset of the input tiddlers in which field <<.place f>> has the value <<.place p>>" +/> -The operand is the value to match, and the suffix is used to identify the field. For example: +If <<.place p>> is empty, <<.op field>> will match both of the following: -|!Filter String |!Description | -|`[field:modifier[JeremyRuston]]` |Returns a list of the tiddlers created by `JeremyRuston` | -|`[modifier[JeremyRuston]]` |Returns a list of the tiddlers created by `JeremyRuston` | +* tiddlers that don't contain field <<.place f>> +* tiddlers in which field <<.place f>> exists but has an empty value -Note that if an unknown filter operator `[unknown[xxx]]` is encountered it is interpreted as `[field:unknown[xxx]]`. +;Negation +: `!field` outputs the subset of the input tiddlers in which field <<.place f>> does <<.em not>> have the value <<.place p>>. + +The [[Filter Syntax]] treats any unrecognised [[filter operator|Filter Operators]] as if it was the suffix to the <<.olink field>> operator. See the second example below. + +<<.operator-examples "field">> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator fields.tid b/editions/tw5.com/tiddlers/filters/FilterOperator fields.tid index 9434bf6f9..59854b39f 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator fields.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator fields.tid @@ -1,13 +1,17 @@ -caption: fields created: 20140924115616653 -modified: 20141002150019737 -tags: Filters -title: FilterOperator: fields +modified: 20150118183051000 +tags: [[Filter Operators]] [[Field Operators]] +title: fields Operator type: text/vnd.tiddlywiki +caption: fields +purpose: get all fields of the input tiddlers -The ''fields'' filter operator returns the names of all the fields used in the currently selected tiddlers. +<$macrocall $name=".operator-def" +input="a [[set|Tiddler Sets]] of tiddler titles" +parameter="none" +output="the [[set|Tiddler Sets]] of all field names contained in the input tiddlers" +/> -|!Filter String |!Description | -|`[[HelloThere]fields[]]` |Returns the fields present in the tiddler `HelloThere` | -|`[tag[myTag]fields[]]` |Returns the aggregate of all the fields present on tiddlers that have the tag `myTag` | +Each input item is processed in turn. Its set of field names is retrieved (in no particular order) and then [[dominantly appended|Dominant Append]] to the operator's output. +<<.operator-examples "fields">> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator first.tid b/editions/tw5.com/tiddlers/filters/FilterOperator first.tid index 5d497cd69..01f18a989 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator first.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator first.tid @@ -1,14 +1,16 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: first -title: FilterOperator: first +modified: 20150118183055000 +tags: [[Filter Operators]] [[List Operators]] +title: first Operator type: text/vnd.tiddlywiki +caption: first +purpose: get the first <<.place n>> input items -The ''first'' filter operator returns the first entries in the current list. The optional operand specifies the number of entries to return. +<$macrocall $name=".operator-def" +input="a [[set|Tiddler Sets]] of strings" +parameter="an integer, defaulting to 1" +paramName="n" +output="the first <<.place n>> items from the input set" +/> -For example: - -|!Filter String |!Description | -|`one two three +[first[]]` |Returns `one` | -|`one two three +[first[2]]` |Returns `one`, `two` | +<<.operator-examples "first">> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator get.tid b/editions/tw5.com/tiddlers/filters/FilterOperator get.tid index 51a000efa..e7001bd62 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator get.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator get.tid @@ -1,13 +1,20 @@ created: 20140426183123179 -modified: 20140426183123179 -tags: Filters -caption: get -title: FilterOperator: get +modified: 20150118183058000 +tags: [[Filter Operators]] [[Field Operators]] +title: get Operator type: text/vnd.tiddlywiki +caption: get +purpose: get the values of a field from all input tiddlers -The ''get'' filter operator replaces the titles of the tiddlers in the current list with the values of the field specified by the operand. +<$macrocall $name=".operator-def" +input="a [[set|Tiddler Sets]] of tiddler titles" +parameter="the name of a [[field|TiddlerFields]]" +paramName="f" +output="the values of field <<.place f>> in each of the input tiddlers" +/> -For example: +Each input tiddler is processed in turn. If the tiddler contains field <<.place f>>, and the value of this field is not empty, then its value is appended to the output. -|!Filter String |!Description | -|`[all[current]get[draft.of]]` |If the current tiddler is a draft, returns the original tiddler, otherwise returns an empty list | +Unlike most other [[Filter Operators]], the output of <<.op get>> can contain duplicates. + +<<.operator-examples "get">> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator has.tid b/editions/tw5.com/tiddlers/filters/FilterOperator has.tid index 245f536b4..2c766cfa7 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator has.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator has.tid @@ -1,14 +1,25 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters CommonFilters -caption: has -title: FilterOperator: has +modified: 20150118183102000 +tags: [[Filter Operators]] [[Common Operators]] [[Field Operators]] +title: has Operator type: text/vnd.tiddlywiki +caption: has +purpose: filter the input tiddlers by field existence -The ''has'' filter operator chooses tiddlers from the current list that have a non-empty value for the field specified in the operand. +<$macrocall $name=".operator-def" +syntax="has[f]" +input="a [[set|Tiddler Sets]] of tiddler titles" +parameter="the name of a field" +paramName="f" +output="the subset of the input tiddlers that have a value in field <<.place f>>" +/> -For example: +<<.op has>> filters out both of the following: -|!Filter String |!Description | -|`[has[modifier]]` |Returns tiddlers that have a `modifier` field | +* tiddlers that don't contain field <<.place f>> +* tiddlers in which field <<.place f>> exists but has an empty value +;Negation +: `!has` outputs the subset of the input tiddlers in which field <<.place f>> does <<.em not>> exist or does not have the value <<.place p>>. + +<<.operator-examples "has">> diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator is.tid b/editions/tw5.com/tiddlers/filters/FilterOperator is.tid index 19408c84b..2e9a21e15 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator is.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator is.tid @@ -1,8 +1,8 @@ created: 20140410103123179 -modified: 20140418103123179 +modified: 20150118182931000 tags: Filters CommonFilters caption: is -title: FilterOperator: is +title: is Operator type: text/vnd.tiddlywiki The ''is'' filter operator selects tiddlers from the current list according to their membership of the category specified in the operand: diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator modules.tid b/editions/tw5.com/tiddlers/filters/FilterOperator modules.tid index abc97a4d8..a54d1b2c0 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator modules.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator modules.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20140410103123179 +modified: 20150118182943000 tags: Filters caption: modules title: FilterOperator: modules diff --git a/editions/tw5.com/tiddlers/filters/FilterOperators.tid b/editions/tw5.com/tiddlers/filters/FilterOperators.tid index 800d635d5..b81cb949c 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperators.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperators.tid @@ -1,17 +1,24 @@ created: 20140410103123179 -modified: 20141007213204936 -tags: Concepts -title: FilterOperators +modified: 20150118180311000 +tags: Concepts Filters +title: Filter Operators type: text/vnd.tiddlywiki -A <> is a predefined name attached to an individual step in a [[filter|Filters]]. It defines how that step is to be performed. +A <<.def "filter operator">> is a predefined name attached to an individual step in a [[filter|Filters]]. It defines the particular action of that step. -A typical step is written as `[operator[parameter]]`, although not all of the operators need a parameter. + + + + + + +<$list filter="[tag[Filter Operators]]"> + + + + +
OperatorPurposeCommon
<$link to={{!!title}}>{{!!caption}}{{!!purpose}}<$list filter="[all[current]tag[Common Operators]]">{{$:/core/images/done-button}}
-Here are the most commonly used operators: +A typical step is written as `[operator[parameter]]`, although not all of the operators need a [[parameter|Filter Parameters]]. -<> - -The complete list is: - -<> +Most steps operate on a set of input items. For the exact rules, see [[Filter Syntax]]. diff --git a/editions/tw5.com/tiddlers/filters/FilterSyntax.tid b/editions/tw5.com/tiddlers/filters/FilterSyntax.tid index 9919467fd..09c3e1126 100644 --- a/editions/tw5.com/tiddlers/filters/FilterSyntax.tid +++ b/editions/tw5.com/tiddlers/filters/FilterSyntax.tid @@ -1,36 +1,36 @@ created: 20140210141217955 -modified: 20150102174633890 +modified: 20150117204215000 tags: Filters title: Filter Syntax type: text/vnd.tiddlywiki -:([[Filters]] follow a grammar that is presented here, using [[RailroadDiagrams]], for those who find formal syntax descriptions helpful. However, [[you can learn to write filters|Introduction to filter notation]] without needing to understand this tiddler.) +<<.preamble """[[Filters]] follow a grammar that is presented here, using [[RailroadDiagrams]], for those who find formal syntax descriptions helpful. However, you can [[learn to write filters|Introduction to filter notation]] without needing to understand this tiddler.""">> -A <> is an expression whose value is an ordered set of items known as its <>. No item can appear more than once in the result. The items are usually tiddler titles, but certain specialised filter steps produce other items, such as field names. +A <<.def filter>> is a pipeline for transforming an <<.def input>> into an <<.def output>>. Both the input and the output are [[ordered sets|Tiddler Sets]] of strings, usually tiddler titles. -A filter is a sequence of zero or more ''runs'', and each run is a sequence of one or more ''steps''. Each step and each run produces its own intermediate result. +Filters are built from smaller pieces, called ''runs'' and ''steps'', each of which also transforms an input to an output. --- ;filter : <$railroad text=""" -[{ : [:whitespace] ("+" | :- | "-") run }] +[{: [:whitespace] ("+"|:-|"-") run }] """/> -A filter starts with an empty result. The runs are processed from left to right, progressively modifying the result. +A filter starts with an empty output. Its runs are processed from left to right, progressively modifying the output. -Each run receives a <> set from which to select items. This is normally the set of all tiddlers in the wiki, in the order they happen to be stored there, but it can be changed by prefixing a run with `+`. +A run's input is normally the set of all tiddler titles in the wiki (in no particular order), but the `+` prefix can change this. -* If the run has no `+` or `-` prefix, the items in its result are <> to the filter's result. If this leaves the filter's result containing two copies of the same item, the earlier one is removed. -* If the run has a `-` prefix, the items in its result are <> from the filter's result if they were present there. -* If the run has a `+` prefix, it receives the filter's current result as its source set. The filter's result is then completely <> by the run's result. Any subsequent run reverts to receiving all tiddlers as its source set, unless it too has a `+` prefix. +* If a run has no `+` or `-` prefix, its output strings are [[dominantly appended|Dominant Append]] to the filter's output. +* If a run has a `-` prefix, its output strings are <<.em removed>> from the filter's output (if they were present). +* If a run has a `+` prefix, it receives the filter's output so far as its input. The filter's output is then completely <<.em replaced>> by the run's output. Any subsequent run reverts to receiving all tiddler titles as its input, unless it too has a `+` prefix. In concise technical terms: -|!Run |!Interpretation |!Result | -|`run` |union of sets|result OR run | -|`+run` |intersection of sets |result AND run | -|`-run` |difference of sets|result AND NOT run | +|!Run |!Interpretation |!Output | +|`run` |union of sets |... OR run | +|`+run` |intersection of sets |... AND run | +|`-run` |difference of sets |... AND NOT run | --- @@ -46,34 +46,22 @@ In concise technical terms: ) """/> -The steps of a run are processed from left to right. Each step receives a source set. For the first step, this is the run's source set. For each subsequent step, the source is the result of the previous step. +The steps of a run are processed from left to right. The input to the first step is same as the input to the run. For each subsequent step, the input is the output of the previous step. -The result of a run depends on the operator involved: +{{Absolute Operators}} -* Most operators are <>. They examine each item in their source set and discard any that don't match. Such steps serve to narrow down the result of their run. -* A few operators, called <>, ignore the source they're given and generate an independent result instead. `title` is a good example. The result of `[title[A]title[B]]` is `B`. But `field` is a filterer, so the result of `[title[A]field:title[B]` is empty. - -The lower three options in the diagram match items like `HelloThere`, `"HelloThere"` and `'HelloThere'`, and are short for `[title[HelloThere]]`. The two quoted options exist to support titles that contain square brackets, such as `"An [[[[Unusual]]]] Tiddler"`. +The lower three options in the diagram match `HelloThere`, `"HelloThere"` and `'HelloThere'`, and are short for `[title[HelloThere]]`. The two quoted options exist to support titles that contain square brackets: `"An [[[[Unusual]]]] Tiddler"`. --- ;step : <$railroad text=""" -[:"!"] [:method] parameter +[:"!"] [:operator [:":" suffix] ] parameter """/> -If a step's method is omitted, it defaults to `title`. +The <<.def operator>> is drawn from a list of [[predefined names|Filter Operators]], which can be extended by plugins. Any unrecognised operator is treated as if it was the suffix to the <<.olink field>> operator. If a step's operator is omitted altogether, it defaults to `title`. ---- - -;method -: <$railroad text=""" -operator [:":" suffix] -"""/> - -The operator is drawn from a list of [[predefined names|FilterOperators]]. If it can't be found in that list, it is instead treated as the suffix to the <> operator. - -The suffix is additional information, usually the name of a [[field|TiddlerFields]], that extends the meaning of certain operators. +The <<.def suffix>> is additional text, usually the name of a [[field|TiddlerFields]], that extends the meaning of certain operators. --- @@ -87,8 +75,8 @@ The suffix is additional information, usually the name of a [[field|TiddlerField ) """/> -* `[`...`]` encloses a literal parameter -* `{`...`}` encloses a TextReference parameter +* `[`...`]` encloses a direct parameter +* `{`...`}` encloses a transcluded parameter * `<`...`>` encloses a [[variable|Variables]] parameter --- @@ -96,4 +84,4 @@ The suffix is additional information, usually the name of a [[field|TiddlerField ;whitespace : <$railroad text=""" {( "space" | "tab" | "linefeed" | "return" | "vertical tab" | "formfeed" )} -"""/> \ No newline at end of file +"""/> diff --git a/editions/tw5.com/tiddlers/filters/Introduction to Filters.tid b/editions/tw5.com/tiddlers/filters/Introduction to Filters.tid index 2ebc691b9..532f9f6f5 100644 --- a/editions/tw5.com/tiddlers/filters/Introduction to Filters.tid +++ b/editions/tw5.com/tiddlers/filters/Introduction to Filters.tid @@ -1,12 +1,12 @@ created: 20140410101941871 -modified: 20141009180223576 +modified: 20150117180519000 tags: Learning Filters title: Introduction to filter notation type: text/vnd.tiddlywiki -:(This explains the basics of writing a [[filter|Filters]] to select a set of tiddlers. For a more technical summary, see [[Filter Syntax]].) +<<.preamble """This explains the basics of writing a [[filter|Filters]] to select a set of tiddlers. For a more technical summary, see [[Filter Syntax]].)""">> -The simplest case is where you already know exactly which tiddlers you want. Type each title in double square brackets, with a space or linebreak between each one and the next: +The simplest case is where you already know exactly which tiddlers you want. Type each title in double square brackets, with a space between each one and the next: ``` [[Recipe book]] [[ScrambledEggs]] [[Mom's apple pie]] @@ -22,22 +22,22 @@ You can omit the square brackets when a title doesn't contain any spaces: The double square brackets are actually a shorthand for this: ``` -[title[Scrambled eggs]] +[title[ScrambledEggs]] ``` -… which gives us the <> for any filter: +... which gives us the <<.def "general model">> for any filter: ``` -[method[parameter]] +[operator[parameter]] ``` -For instance, here's how to select all the tiddlers that have been tagged <>: +For instance, here's how to select all the tiddlers that have been tagged <<.tag Recipe>>: ``` [tag[Recipe]] ``` -We can reverse the meaning by adding an exclamation mark `!` just before the method. For example, we can select any tiddlers that do <> have the <> tag: +We can reverse the meaning by adding an exclamation mark `!` just before the operator. For example, we can select any tiddlers that do <<.em not>> have the <<.tag Recipe>> tag: ``` [!tag[Recipe]] @@ -49,9 +49,9 @@ Tiddlers can be filtered by other fields than just title and tags: [field:serving[4]] ``` -That example will select any tiddlers that have <> in their <> field. +That example will select any tiddlers that have <<.value 4>> in their <<.field serving>> field. -As the word "serving" isn't a standard filter method (and isn't likely to become one), you can safely omit the `field:` prefix: +As the word "serving" isn't a standard filter operator (and isn't likely to become one), you can safely omit the `field:` prefix: ``` [serving[4]] @@ -59,7 +59,7 @@ As the word "serving" isn't a standard filter method (and isn't likely to become !Combinations -The filters we've looked at so far have involved just one step each. But you can <> several steps together like this: +The filters we've looked at so far have involved just one step each. But you can <<.def run>> several steps together like this: ``` [tag[Vegetarian]!tag[soup]serving[4]] @@ -67,9 +67,9 @@ The filters we've looked at so far have involved just one step each. But you can Notice how the entire run is contained in a single pair of square brackets. -A tiddler has to match <> of the steps in a run. So the example above retrieves vegetarian recipes (other than soups) for 4 people. +A tiddler has to match <<.em all>> of the steps in a run. So the example above retrieves vegetarian recipes (other than soups) for 4 people. -A <> of runs will select the tiddlers that match <> of the runs. We can use this to find recipes that serve either 3, 4 or 5 people: +A sequence of separate runs will select the tiddlers that match <<.em any>> of the runs. We can use this to find recipes that serve either 3, 4 or 5 people: ``` [serving[3]] [serving[4]] [serving[5]] @@ -87,9 +87,9 @@ By default, each run considers every tiddler in the wiki. But we can use a `+` s [serving[3]] [serving[4]] [serving[5]] +[tag[Vegetarian]] +[sort[title]] ``` -This selects recipes for 3, 4 or 5 people, then filters <> to remove the vegetarian ones, and finally sorts any that are left into alphabetical order of title. +This selects recipes for 3, 4 or 5 people, then filters <<.em those>> to remove the vegetarian ones, and finally sorts any that are left into alphabetical order of title. -In a similar way, we can use a `-` sign to <> a run's tiddlers from the result so far. Here we select all vegetarian recipes apart from two: +In a similar way, we can use a `-` sign to <<.em remove>> a run's tiddlers from the result so far. Here we select all vegetarian recipes apart from two: ``` [tag[Vegetarian]] -[title[ScrambledEggs]] -BeansOnToast @@ -99,7 +99,7 @@ In a similar way, we can use a `-` sign to <> a run's tiddlers fr The parameter of each step we've seen so far has been in square brackets, meaning that ~TiddlyWiki treats it literally. But two other kinds of bracket are possible: -<> `{}` mean that the parameter is a TextReference, and that its value is to be looked up in a specified tiddler. For example, if we have a tiddler called <> whose text happens to be the word <>, we can say +<<.def "Curly brackets">> `{}` mean that the parameter is a TextReference, and that its value is to be looked up in a specified tiddler. For example, if we have a tiddler called <<.tid Preference>> whose text happens to be the word <<.value Vegetarian>>, we can say ``` [tag{Preference}] @@ -107,8 +107,8 @@ The parameter of each step we've seen so far has been in square brackets, meanin as an alternative to `[tag[Vegetarian]]`. This allows the preference to change over time. -<> `<>` mean that the parameter is the name of a [[variable|Variables]] whose value is to be used instead. Here we use the built-in <> variable in a filter that selects any tiddlers whose text contains the title of the current one: +<<.def "Angle brackets">> `<>` mean that the parameter is the name of a [[variable|Variables]] whose value is to be used instead. Here we use the built-in <<.clink currentTiddler "WidgetVariable: currentTiddler">> variable in a filter that selects any tiddlers whose text contains the title of the current one: ``` [search] -``` \ No newline at end of file +``` diff --git a/editions/tw5.com/tiddlers/filters/dummies/Days of the Week.tid b/editions/tw5.com/tiddlers/filters/dummies/Days of the Week.tid new file mode 100644 index 000000000..edb5514b6 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/dummies/Days of the Week.tid @@ -0,0 +1,11 @@ +created: 20150117192110000 +modified: 20150118132010000 +title: Days of the Week +type: text/vnd.tiddlywiki +list: Monday Tuesday Wednesday Thursday Friday Saturday Sunday + +<<.this-is-operator-example>> + +It has a <<.field list>> field containing the following items: + +<> diff --git a/editions/tw5.com/tiddlers/filters/dummies/Friday.tid b/editions/tw5.com/tiddlers/filters/dummies/Friday.tid new file mode 100644 index 000000000..b9acc6a27 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/dummies/Friday.tid @@ -0,0 +1,6 @@ +created: 20150117192111000 +modified: 20150118131534000 +title: Friday +type: text/vnd.tiddlywiki + +<<.this-is-operator-example>> diff --git a/editions/tw5.com/tiddlers/filters/dummies/Monday.tid b/editions/tw5.com/tiddlers/filters/dummies/Monday.tid new file mode 100644 index 000000000..3ee569c03 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/dummies/Monday.tid @@ -0,0 +1,6 @@ +created: 20150117192113000 +modified: 20150118131645000 +title: Monday +type: text/vnd.tiddlywiki + +<<.this-is-operator-example>> diff --git a/editions/tw5.com/tiddlers/filters/dummies/Saturday.tid b/editions/tw5.com/tiddlers/filters/dummies/Saturday.tid new file mode 100644 index 000000000..a9c439903 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/dummies/Saturday.tid @@ -0,0 +1,6 @@ +created: 20151620490000000 +modified: 20150118131537000 +title: Saturday +type: text/vnd.tiddlywiki + +<<.this-is-operator-example>> diff --git a/editions/tw5.com/tiddlers/filters/dummies/Sunday.tid b/editions/tw5.com/tiddlers/filters/dummies/Sunday.tid new file mode 100644 index 000000000..0817e2708 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/dummies/Sunday.tid @@ -0,0 +1,6 @@ +created: 20150117192115000 +modified: 20150118131539000 +title: Sunday +type: text/vnd.tiddlywiki + +<<.this-is-operator-example>> diff --git a/editions/tw5.com/tiddlers/filters/dummies/Thursday.tid b/editions/tw5.com/tiddlers/filters/dummies/Thursday.tid new file mode 100644 index 000000000..ba051a8a8 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/dummies/Thursday.tid @@ -0,0 +1,13 @@ +created: 20150117192116000 +modified: 20150118131552000 +title: Thursday +type: text/vnd.tiddlywiki + +<<.this-is-operator-example>> + +! <<.olink before>> and <<.olink after>> + +<<.using-days-of-week>> + +<<.operator-example "[list[Days of the Week]before{!!title}]">> +<<.operator-example "[list[Days of the Week]after{!!title}]">> diff --git a/editions/tw5.com/tiddlers/filters/dummies/Tuesday.tid b/editions/tw5.com/tiddlers/filters/dummies/Tuesday.tid new file mode 100644 index 000000000..5d5fc90df --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/dummies/Tuesday.tid @@ -0,0 +1,6 @@ +created: 20150117192118000 +modified: 20150118131558000 +title: Tuesday +type: text/vnd.tiddlywiki + +<<.this-is-operator-example>> diff --git a/editions/tw5.com/tiddlers/filters/dummies/Wednesday.tid b/editions/tw5.com/tiddlers/filters/dummies/Wednesday.tid new file mode 100644 index 000000000..2fc54e6bd --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/dummies/Wednesday.tid @@ -0,0 +1,6 @@ +created: 20150117192119000 +modified: 20150118131707000 +title: Wednesday +type: text/vnd.tiddlywiki + +<<.this-is-operator-example>> diff --git a/editions/tw5.com/tiddlers/filters/examples/addprefix.tid b/editions/tw5.com/tiddlers/filters/examples/addprefix.tid new file mode 100644 index 000000000..78d97d2c4 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/addprefix.tid @@ -0,0 +1,7 @@ +created: 20150118132851000 +modified: 20150118183116000 +tags: [[addprefix Operator]] [[Operator Examples]] +title: addprefix Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "Cat Garden [[Favourite Armchair]] +[addprefix[My ]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/addsuffix.tid b/editions/tw5.com/tiddlers/filters/examples/addsuffix.tid new file mode 100644 index 000000000..490ff945b --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/addsuffix.tid @@ -0,0 +1,7 @@ +created: 20150118134542000 +modified: 20150118183121000 +tags: [[addsuffix Operator]] [[Operator Examples]] +title: addsuffix Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[[London]addsuffix[ Underground]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/after.tid b/editions/tw5.com/tiddlers/filters/examples/after.tid new file mode 100644 index 000000000..c594326df --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/after.tid @@ -0,0 +1,10 @@ +created: 20150118134611000 +modified: 20150118183126000 +tags: [[after Operator]] [[Operator Examples]] +title: after Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> The [[Thursday]] tiddler shows a further example. + +<<.operator-example 1 "[list[Days of the Week]after[Monday]]">> +<<.operator-example 2 "[list[Days of the Week]after[Sunday]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/all.tid b/editions/tw5.com/tiddlers/filters/examples/all.tid new file mode 100644 index 000000000..f2e079a52 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/all.tid @@ -0,0 +1,14 @@ +created: 20150118134646000 +modified: 20150118183130000 +tags: [[all Operator]] [[Operator Examples]] +title: all Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[all[shadows]]">> +<<.operator-example 2 "[all[shadows+tiddlers]]">> +<<.operator-example 3 "[all[tiddlers+shadows]]">> +<<.operator-example 4 "[all[orphans+missing+current]]">> +<<.operator-example 5 "[all[current]]">> +<<.operator-example 6 "[all[current]tag[Operator Examples]]">> +<<.operator-example 7 "[all[current]tag[Recipes]]">> +<<.operator-example 8 "Monday Thursday +[all[]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/backlinks.tid b/editions/tw5.com/tiddlers/filters/examples/backlinks.tid new file mode 100644 index 000000000..f9366f595 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/backlinks.tid @@ -0,0 +1,9 @@ +created: 20150118134611000 +modified: 20150118183135000 +tags: [[backlinks Operator]] [[Operator Examples]] +title: backlinks Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[[HelloThere]backlinks[]]">> +<<.operator-example 2 "[tag[TableOfContents]backlinks[]]" "tiddlers that link to tiddlers tagged [[TableOfContents]]">> +<<.operator-example 3 "[all[current]backlinks[]]" "tiddlers that link to this one">> diff --git a/editions/tw5.com/tiddlers/filters/examples/before.tid b/editions/tw5.com/tiddlers/filters/examples/before.tid new file mode 100644 index 000000000..5e25f3dab --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/before.tid @@ -0,0 +1,10 @@ +created: 20150118134611000 +modified: 20150118183139000 +tags: [[before Operator]] [[Operator Examples]] +title: before Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> The [[Thursday]] tiddler shows a further example. + +<<.operator-example 1 "[list[Days of the Week]before[Saturday]]">> +<<.operator-example 2 "[list[Days of the Week]before[Monday]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/butlast.tid b/editions/tw5.com/tiddlers/filters/examples/butlast.tid new file mode 100644 index 000000000..6a0e2b235 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/butlast.tid @@ -0,0 +1,11 @@ +created: 20150118134611000 +modified: 20150118183143000 +tags: [[butlast Operator]] [[Operator Examples]] +title: butlast Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]butlast[]]">> +<<.operator-example 2 "[list[Days of the Week]butlast[2]]">> +<<.operator-example 3 "A B C D E F G H I J K L M +[butlast[7]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/commands.tid b/editions/tw5.com/tiddlers/filters/examples/commands.tid new file mode 100644 index 000000000..328b207ac --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/commands.tid @@ -0,0 +1,7 @@ +created: 20150118134611000 +modified: 20150118183148000 +tags: [[commands Operator]] [[Operator Examples]] +title: commands Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[commands[]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/each.tid b/editions/tw5.com/tiddlers/filters/examples/each.tid new file mode 100644 index 000000000..0b5017957 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/each.tid @@ -0,0 +1,10 @@ +created: 20150118134611000 +modified: 20150118183152000 +tags: [[each Operator]] [[Operator Examples]] +title: each Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[each[color]]">> +<<.operator-example 2 "[sort[title]each[type]]" "the alphabetically first tiddler of each type">> + +For an example of using the <<.op each>> operator to generate a two-tier list of groups and members, see [[GroupedLists]]. diff --git a/editions/tw5.com/tiddlers/filters/examples/eachday.tid b/editions/tw5.com/tiddlers/filters/examples/eachday.tid new file mode 100644 index 000000000..b195c83c7 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/eachday.tid @@ -0,0 +1,9 @@ +created: 20150118134611000 +modified: 20150118183156000 +tags: [[eachday Operator]] [[Operator Examples]] +title: eachday Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[eachday[created]]" "the first tiddler created on each day">> + +For an example of using the <<.op eachday>> operator to generate a two-tier list of groups and members, see [[GroupedLists]]. diff --git a/editions/tw5.com/tiddlers/filters/examples/field.tid b/editions/tw5.com/tiddlers/filters/examples/field.tid new file mode 100644 index 000000000..9192d4cc3 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/field.tid @@ -0,0 +1,8 @@ +created: 20150118134611000 +modified: 20150118183202000 +tags: [[field Operator]] [[Operator Examples]] +title: field Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[field:author[JeremyRuston]]" "plugins authored by JeremyRuston">> +<<.operator-example 2 "[plugin-type[theme]author[JeremyRuston]]" "themes authored by JeremyRuston">> diff --git a/editions/tw5.com/tiddlers/filters/examples/fields.tid b/editions/tw5.com/tiddlers/filters/examples/fields.tid new file mode 100644 index 000000000..decfec7ca --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/fields.tid @@ -0,0 +1,8 @@ +created: 20150118134611000 +modified: 20150118183206000 +tags: [[fields Operator]] [[Operator Examples]] +title: fields Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[[HelloThere]fields[]]" "fields of HelloThere">> +<<.operator-example 2 "[tag[Common Operators]fields[]]" "fields of all tiddlers tagged as [[Common Operators]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/first.tid b/editions/tw5.com/tiddlers/filters/examples/first.tid new file mode 100644 index 000000000..f11803057 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/first.tid @@ -0,0 +1,11 @@ +created: 20150118134611000 +modified: 20150118183210000 +tags: [[first Operator]] [[Operator Examples]] +title: first Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]first[]]">> +<<.operator-example 2 "[list[Days of the Week]first[5]]">> +<<.operator-example 3 "[tag[Filter Operators]!sort[title]first[]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/get.tid b/editions/tw5.com/tiddlers/filters/examples/get.tid new file mode 100644 index 000000000..a1bae36e0 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/get.tid @@ -0,0 +1,8 @@ +created: 20150118134611000 +modified: 20150118183215000 +tags: [[get Operator]] [[Operator Examples]] +title: get Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[all[current]get[draft.of]]" "the title of the tiddler of which the current tiddler is a draft">> +<<.operator-example 2 "[get[tags]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/has.tid b/editions/tw5.com/tiddlers/filters/examples/has.tid new file mode 100644 index 000000000..7691d9fc4 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/has.tid @@ -0,0 +1,9 @@ +created: 20150118165921000 +modified: 20150118183219000 +tags: [[has Operator]] [[Operator Examples]] +title: has Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[has[color]]">> +<<.operator-example 2 "[tag[Concepts]!has[modified]]">> + diff --git a/editions/tw5.com/tiddlers/howtos/Tagging.tid b/editions/tw5.com/tiddlers/howtos/Tagging.tid index 5b6cf411d..12a6edb27 100644 --- a/editions/tw5.com/tiddlers/howtos/Tagging.tid +++ b/editions/tw5.com/tiddlers/howtos/Tagging.tid @@ -1,5 +1,5 @@ created: 20140904075400000 -modified: 20140919155913046 +modified: 20150118182337000 tags: [[Working with TiddlyWiki]] Concepts title: Tagging type: text/vnd.tiddlywiki @@ -33,7 +33,7 @@ You can use the [[tag manager|$:/TagManager]], found on the ''Tags'' tab under ' ! Change the order in which tags are listed -By default, tagged tiddlers are listed in the order they were added to the wiki. The [[sort operator|Filter operator: sort]] can change the order to alphabetical. +By default, tagged tiddlers are listed in the order they were added to the wiki. The <<.olink sort>> operator can change the order to alphabetical. If you want any other order, add a [[field called ''list''|ListField]] to the tag tiddler, and set its value to be a [[TitleList]] of the tiddlers in that order. diff --git a/editions/tw5.com/tiddlers/releasenotes/Release 5.1.3.tid b/editions/tw5.com/tiddlers/releasenotes/Release 5.1.3.tid index 72be362ee..1b1e16edf 100644 --- a/editions/tw5.com/tiddlers/releasenotes/Release 5.1.3.tid +++ b/editions/tw5.com/tiddlers/releasenotes/Release 5.1.3.tid @@ -1,6 +1,6 @@ caption: 5.1.3 created: 20141020171015200 -modified: 20141020171015200 +modified: 20150118182805000 tags: ReleaseNotes title: Release 5.1.3 type: text/vnd.tiddlywiki @@ -25,14 +25,14 @@ released: 20141020171015200 * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/2ffe53f1916e4b746cc6d7e74e8f4ac75c72e38a]] audio "parser" for handling [[Audio]] content * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/0dcf54c3b59ed04645928f0ec4ced647e5a0da7f]] support for ActionWidgets -* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/65504d5d41e45326ab1b1b6c0c21eea4c9772797]] new [[FilterOperator: addprefix]] and [[FilterOperator: addsuffix]] +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/65504d5d41e45326ab1b1b6c0c21eea4c9772797]] new <<.olink addprefix>> and <<.olink addsuffix>> operators * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/0c8e5380778303cdd3308bed4a15290214841f8b]] support for custom password prompts * [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/c26bd4c5a872f56c47e9f5cfc3fada468c53ddde]] the ListMacro to display ''caption'' field if present * [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/12e26009eef5e29140ba1a880ff033428d673630]] ImageWidget to allow percentage width and height to be specified !! Bug Fixes -* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/cc576b052e2b05fd93fcb4f3eb8d9ee5278abf3e]] [[FilterOperator: each]] to work with missing tiddlers +* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/cc576b052e2b05fd93fcb4f3eb8d9ee5278abf3e]] the <<.olink each>> operator to work with missing tiddlers * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/5dd6ebff05a3380db2901294b2cfc89c1a0e71bf]] problem with tiddler width in zoomin storyview with the sidebar hidden * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/09b6540998fec6bf1fb14842be8e8c53dbd5c46a]] bug whereby the `tm-home` message wasn't navigating to a tiddler, causing problems in zoomin storyview * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/3ca8d7b6cca46ffa424bcf9bdc134da464fc84f4]] problem with jumping toolbar icons under Firefox diff --git a/editions/tw5.com/tiddlers/releasenotes/Release 5.1.5.tid b/editions/tw5.com/tiddlers/releasenotes/Release 5.1.5.tid index 1fda65ca4..bafcdf053 100644 --- a/editions/tw5.com/tiddlers/releasenotes/Release 5.1.5.tid +++ b/editions/tw5.com/tiddlers/releasenotes/Release 5.1.5.tid @@ -1,6 +1,6 @@ caption: 5.1.5 created: 20141025120850184 -modified: 20141126153016142 +modified: 20150118182717000 tags: ReleaseNotes title: Release 5.1.5 type: text/vnd.tiddlywiki @@ -40,7 +40,7 @@ released: 20141126153016142 * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/c20c935faabbb63f679bc4720b52162c56b6af64]] new system image for videos: [[$:/core/images/video]] * [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/c13cf94413c94ee56bebc60fab2d9231d1824d88]] search results to allow custom visualisations - see [[Customising search results]] * [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/a3a50dbf6d96e7441e5e8ec183e40134bc4eb618]] TimelineMacro to be able to use different date fields -* [[Update|https://github.com/Jermolene/TiddlyWiki5/commit/8260d000be1cf1caf35a557f6cd54a0fb8ccf4f0]] [[FilterOperator: search]] to allow a field to be specified +* [[Updated|https://github.com/Jermolene/TiddlyWiki5/commit/8260d000be1cf1caf35a557f6cd54a0fb8ccf4f0]] the <<.olink search>> operator to allow a field to be specified * [[Updated|https://github.com/Jermolene/TiddlyWiki5/commit/73491f14dd63612d527632210d2c3873eb81188f]] the highlight plugin to display tabs as spaces * [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/91a7c397911726e391ca368f96b50fbe1687d56a]] modal handling to permit variables to be passed to the modal (see [[WidgetMessage: tm-modal]]) * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/853f5fd06402b16e271e8f119ef380de485aeff2]] simple logging to help track down drop/paste issues (see http://tiddlywiki.com/dev/#ImportLogging) diff --git a/editions/tw5.com/tiddlers/releasenotes/Release 5.1.6.tid b/editions/tw5.com/tiddlers/releasenotes/Release 5.1.6.tid index 85e1faabd..06e65feaf 100644 --- a/editions/tw5.com/tiddlers/releasenotes/Release 5.1.6.tid +++ b/editions/tw5.com/tiddlers/releasenotes/Release 5.1.6.tid @@ -1,6 +1,6 @@ caption: 5.1.6 created: 20141127120850184 -modified: 20141127153016142 +modified: 20150118182735000 tags: ReleaseNotes title: Release 5.1.6 type: text/vnd.tiddlywiki @@ -20,7 +20,7 @@ released: 20141219155007260 * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/b220c19fb7b789eb6d00c9d1a71414676d87130e]] support for templates to tabbed TableOfContentsMacro * [[Allow|https://github.com/Jermolene/TiddlyWiki5/commit/31b5eb1578640fabe8712f0cd4edd49708bc4493]] shadow tiddlers to appear in TableOfContentsMacro * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/5154a25ab95f0cc08eb079a624be4fd3353e6dbd]] tooltip to BrowseWidget -* [[Improved|https://github.com/Jermolene/TiddlyWiki5/commit/42dba113ccdb18d7e76ac7a773c7dca532207007]] handling of missing tiddlers by the [[FilterOperator: has]] and [[FilterOperator: field]] +* [[Improved|https://github.com/Jermolene/TiddlyWiki5/commit/42dba113ccdb18d7e76ac7a773c7dca532207007]] handling of missing tiddlers by the <<.olink has>> and <<.olink field>> operators !! Bug Fixes diff --git a/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.10beta.tid b/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.10beta.tid index b56838220..f2ff0a861 100644 --- a/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.10beta.tid +++ b/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.10beta.tid @@ -1,5 +1,5 @@ created: 20140416160234142 -modified: 20140416160234142 +modified: 20150118182457000 tags: BetaReleaseNotes title: Release 5.0.10-beta type: text/vnd.tiddlywiki @@ -25,7 +25,7 @@ caption: 5.0.10-beta !! Hackability Improvements -* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/15d0c27e2a82359616ce6c7883557cd2ef1886cd]] `[is[tag]]` to the [[FilterOperator: is]] +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/15d0c27e2a82359616ce6c7883557cd2ef1886cd]] `[is[tag]]` to the <<.olink is>> operator * [[Hide|https://github.com/Jermolene/TiddlyWiki5/commit/95d291daac4a26664f0c232175f54780f0fa678f]] the top bars in the print stylesheet !! Bug Fixes diff --git a/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.11beta.tid b/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.11beta.tid index 222b0c032..ca6d93585 100644 --- a/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.11beta.tid +++ b/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.11beta.tid @@ -1,5 +1,5 @@ created: 20140516150234142 -modified: 20140516150234142 +modified: 20150118182530000 tags: BetaReleaseNotes title: Release 5.0.11-beta type: text/vnd.tiddlywiki @@ -38,8 +38,8 @@ See [[Notes for upgrading to 5.0.11-beta]] for more details of these changes: * Improved vertical layouts of TabsMacro * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/93566cdc332226b77eaba8a70fa166f3b8fcfe1e]] "standard" tab to [[advanced search|$:/AdvancedSearch]] -* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/e83759e86d2a9e05e4b85dae50925fe988f8e239]] new filter operators [[before|FilterOperator: before]] and [[after|FilterOperator: after]] -* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/570cad1c7f90e685961130918f09a7f9b2951f8c]] new [[FilterOperator: get]] +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/e83759e86d2a9e05e4b85dae50925fe988f8e239]] new filter operators <<.olink before>> and <<.olink after>> +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/570cad1c7f90e685961130918f09a7f9b2951f8c]] new <<.olink get>> operator * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/f7e50e0950c5bf10d94d926576011893418b25f1]] [[BuildCommand]], [[OutputCommand]] and [[ClearPasswordCommand]] * Added new extensible StartupMechanism for orchestrating startup tasks * [[Updated|https://github.com/Jermolene/TiddlyWiki5/commit/711b76307c95d0026f79f584e85ae3d4b7289d15]] to new version of CodeMirror diff --git a/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.13beta.tid b/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.13beta.tid index 40e216fba..764ce3937 100644 --- a/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.13beta.tid +++ b/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.13beta.tid @@ -1,5 +1,5 @@ created: 20140518150234142 -modified: 20140624094134118 +modified: 20150118182554000 tags: BetaReleaseNotes title: Release 5.0.13-beta type: text/vnd.tiddlywiki @@ -41,7 +41,7 @@ This release includes a number of features designed to improve the experience of * [[Refactored|https://github.com/Jermolene/TiddlyWiki5/commit/1717c93d001ad184a08ca66d1bffb33fb5d32b3a]] CodeMirror (http://tiddlywiki.com/codemirrordemo.html) plugin for simpler configuration * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/b2e48d00e9ea068a22b5ac5c0a4c93e8ddbb4a8a]] support for [[Environment Variables on Node.js]] * [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/eee3a0cf8e5aa047f8596df06e28194409f38b01]] ServerCommand to allow a path prefix -* [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/4238af2a405c14d22937d7c47a70bfb3d4e6f22d]] [[FilterOperator: listed]] to use any list field +* [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/4238af2a405c14d22937d7c47a70bfb3d4e6f22d]] the <<.olink listed>> operator to use any list field !! Bug Fixes diff --git a/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.16beta.tid b/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.16beta.tid index 1adef028a..7218fcaff 100644 --- a/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.16beta.tid +++ b/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.16beta.tid @@ -1,6 +1,6 @@ caption: 5.0.16-beta created: 20140830131615798 -modified: 20140902124037214 +modified: 20150118182819000 tags: BetaReleaseNotes title: Release 5.0.16-beta type: text/vnd.tiddlywiki @@ -34,11 +34,11 @@ Many thanks to @buggyj for his work on this plugin. !! Hackability Improvements -* [[Extend|https://github.com/Jermolene/TiddlyWiki5/commit/48312272adb17610db96d50758e6af947cab7b1d]] the [[FilterOperator: all]] to be able to select all the source tiddlers +* [[Extend|https://github.com/Jermolene/TiddlyWiki5/commit/48312272adb17610db96d50758e6af947cab7b1d]] the <<.olink all>> operator to be able to select all the source tiddlers * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/43aeb47fc34f1ba424030c4f78ee907fe7b1d5d8]] problem with single line macro definitions incorrectly including whitespace in the value. (For example, `\define mymacro() yes` would set the macro value to " yes", with a leading space) * [[Extend|https://github.com/Jermolene/TiddlyWiki5/commit/d2a5a12f2d6b6ccc36dd22a70ac2def08d1d3722]] TableOfContentsMacro to use the caption field if present * [[Configurability|https://github.com/Jermolene/TiddlyWiki5/commit/b437f1b450f5f2a3104a9086f7c674299b53b9bc]] for the default tab shown in the tiddler info panel (see [[Configuring the default TiddlerInfo tab]]) -* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/dcf4e93a3283e3e93cc14e50366f9b0252870835]] [[suffix|FilterOperator: suffix]] and [[removesuffix|FilterOperator: removesuffix]] filter operators +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/dcf4e93a3283e3e93cc14e50366f9b0252870835]] <<.olink suffix>> and <<.olink removesuffix>> operators !! Bug Fixes diff --git a/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.17beta.tid b/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.17beta.tid index 1c69c4533..dba71042a 100644 --- a/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.17beta.tid +++ b/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.17beta.tid @@ -1,6 +1,6 @@ caption: 5.0.17-beta created: 20140910131615798 -modified: 20140912164804565 +modified: 20150118182638000 tags: BetaReleaseNotes title: Release 5.0.17-beta type: text/vnd.tiddlywiki @@ -30,7 +30,7 @@ The use of the `title` attribute in the ButtonWidget was not consistent with the As discussed in [[the associated ticket|https://github.com/Jermolene/TiddlyWiki5/issues/762]], the support for regular expression filter operands is incomplete and inconsistent. The plan is to remove support for this feature in the next release. A new filter operator has been provided to replace it, along with the addition of a deprecation warning that is displayed whenever regular expression filter operators are used. -* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/f4fff7a33037ba9dd537379bcb44a52a280868d6]] new [[FilterOperator: regexp]] +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/f4fff7a33037ba9dd537379bcb44a52a280868d6]] new <<.olink regexp>> operator * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/d45c417c187fe3dcc35ee7a308e64feebc7b185b]] deprecation warning for regular expression filter operators !!! Repository Reorganisation diff --git a/editions/tw5.com/tiddlers/styleguide/Documentation Macros.tid b/editions/tw5.com/tiddlers/styleguide/Documentation Macros.tid index 65f96709f..7c3da4ced 100644 --- a/editions/tw5.com/tiddlers/styleguide/Documentation Macros.tid +++ b/editions/tw5.com/tiddlers/styleguide/Documentation Macros.tid @@ -1,140 +1,147 @@ created: 20150110182600000 +modified: 20150117180524000 title: Documentation Macros tags: [[Improving TiddlyWiki Documentation]] -The following macros are used throughout the documentation. +The following macros are used throughout ~TiddlyWiki's documentation. !General |!Macro |!Used for |!Example | -|doc-def |the defining instance of a term |<> | -|doc-em |minor emphasis within a sentence |<> | -|doc-ph |a placeholder for the user to fill in |<> | -|doc-strong |major emphasis within a tiddler |<> | -|doc-w |a mention of an ordinary word or phrase |<> | +|.def |the defining instance of a term |<<.def widget>> | +|.em |minor emphasis within a sentence |<<.em not>> | +|.place |a placeholder for the user to fill in |<<.place tagname>> | +|.strong |major emphasis within a tiddler |<<.strong Important!>> | +|.word |a mention of an ordinary word or phrase |<<.word "hello world">> | + +!Blocks +|!Macro |!Used for | +|.preamble |an introductory sentence that stands apart from the rest of the tiddler | !Tiddlers and fields |!Macro |!Used for |!Example | -|doc-tiddler |a tiddler title|<> | -|doc-tag |a tag |<> | -|doc-field|a field name|<> | -|doc-field-value|a field value|<> | -|doc-var|a variable or macro name|<> | -|doc-widget|a widget name|<> | +|.tid |a tiddler title|<<.tid Example>> | +|.tag |a tag |<<.tag Example>> | +|.field|a field name|<<.field example>> | +|.value|a field value|<<.value "example value">> | +|.op|a filter operator|<<.op backlinks>> | +|.var|a variable or macro name|<<.var currentTiddler>> | +|.wid|a widget name|<<.wid list>> | !Links |!Macro |!Used for |!Example | -|doc-link |a link containing WikiText |<> | -|doc-clink |a code link |<` ListWidget>> | +|.link |a link containing WikiText |<<.link "^^an^^ ~~example~~" Example>> | +|.clink |a code link |<<.clink `<$list>` ListWidget>> | +|.flink |a link to a field |<<.flink ListField>> | +|.olink |a link to an operator |<<.olink prefix>> | +|.wlink |a link to a widget |<<.wlink ButtonWidget>> | !User interface |!Macro |!Used for |!Example | -|doc-key |a key on the keyboard |<> | -|doc-key-combo |a key combination |<> | -|doc-input |text entered by the user |<> | -|doc-output |text output by the system |<> | +|.key |a key on the keyboard |<<.key Escape>> | +|.keycombo |a key combination |<<.keycombo Ctrl Enter>> | !Tabs |!Macro |!Used for |!Example | -|doc-sidebar-tab |the name of a sidebar tab |<> | -|doc-more-tab |the name of a subtab of the More tab |<> | -|doc-info-tab |the name of a tiddler info tab |<> | -|doc-controlpanel-tab |the name of a Control Panel tab |<> | -|doc-advancedsearch-tab |the name of an Advanced Search tab |<> | -|doc-toc-tab |name of the tw5.com TOC tab |<> | -|doc-example-tab |an example tab name |<> | +|.sidebar-tab |the name of a sidebar tab |<<.sidebar-tab More>> | +|.more-tab |the name of a subtab of the More tab |<<.more-tab Shadows>> | +|.info-tab |the name of a tiddler info tab |<<.info-tab Fields>> | +|.controlpanel-tab |the name of a Control Panel tab |<<.controlpanel-tab Settings>> | +|.advancedsearch-tab |the name of an Advanced Search tab |<<.advancedsearch-tab Filter>> | +|.toc-tab |name of the tw5.com TOC tab |<<.toc-tab>> | +|.example-tab |an example tab name |<<.example-tab "Notes">> | -!!Parameters for doc-sidebar-tab +!!Parameters for .sidebar-tab -|Open |<> | -|Recent |<> | -|Tools |<> | -|More |<> | +|Open |<<.sidebar-tab Open>> | +|Recent |<<.sidebar-tab Recent>> | +|Tools |<<.sidebar-tab Tools>> | +|More |<<.sidebar-tab More>> | -!!Parameters for doc-more-tab +!!Parameters for .more-tab -|All |<> | -|Recent |<> | -|Tags |<> | -|Missing |<> | -|Drafts |<> | -|Orphans |<> | -|Types |<> | -|System |<> | -|Shadows |<> | +|All |<<.more-tab All>> | +|Recent |<<.more-tab Recent>> | +|Tags |<<.more-tab Tags>> | +|Missing |<<.more-tab Missing>> | +|Drafts |<<.more-tab Drafts>> | +|Orphans |<<.more-tab Orphans>> | +|Types |<<.more-tab Types>> | +|System |<<.more-tab System>> | +|Shadows |<<.more-tab Shadows>> | -!!Parameters for doc-info-tab +!!Parameters for .info-tab -|Tools |<> | -|References |<> | -|Tagging |<> | -|List |<> | -|Listed |<> | -|Fields |<> | -|Advanced |<> | +|Tools |<<.info-tab Tools>> | +|References |<<.info-tab References>> | +|Tagging |<<.info-tab Tagging>> | +|List |<<.info-tab List>> | +|Listed |<<.info-tab Listed>> | +|Fields |<<.info-tab Fields>> | +|Advanced |<<.info-tab Advanced>> | -!!Parameters for doc-controlpanel-tab +!!Parameters for .controlpanel-tab -|Info |<> | -|Appearance |<> | -|Settings |<> | -|Saving |<> | -|Plugins |<> | +|Info |<<.controlpanel-tab Info>> | +|Appearance |<<.controlpanel-tab Appearance>> | +|Settings |<<.controlpanel-tab Settings>> | +|Saving |<<.controlpanel-tab Saving>> | +|Plugins |<<.controlpanel-tab Plugins>> | -!!Parameters for doc-advancedsearch-tab +!!Parameters for .advancedsearch-tab -|Standard |<> | -|System |<> | -|Shadows |<> | -|Filter |<> | +|Standard |<<.advancedsearch-tab Standard>> | +|System |<<.advancedsearch-tab System>> | +|Shadows |<<.advancedsearch-tab Shadows>> | +|Filter |<<.advancedsearch-tab Filter>> | !Buttons |!Macro |!Used for |!Example | -|doc-button |a standard button name and icon |<> | +|.button |a standard button name and icon |<<.button "new-tiddler">> | -!!Parameters for doc-button +!!Parameters for .button !!!Tiddler toolbar -|clone |<> | -|close |<> | -|close-others |<> | -|edit |<> | -|export-tiddler |<> | -|info |<> | -|more-tiddler-actions |<> | -|new-here |<> | -|new-journal-here |<> | -|permalink |<> | +|clone |<<.button "clone">> | +|close |<<.button "close">> | +|close-others |<<.button "close-others">> | +|edit |<<.button "edit">> | +|export-tiddler |<<.button "export-tiddler">> | +|info |<<.button "info">> | +|more-tiddler-actions |<<.button "more-tiddler-actions">> | +|new-here |<<.button "new-here">> | +|new-journal-here |<<.button "new-journal-here">> | +|permalink |<<.button "permalink">> | !!!Edit-mode toolbar -|cancel |<> | -|delete |<> | -|save |<> | +|cancel |<<.button "cancel">> | +|delete |<<.button "delete">> | +|save |<<.button "save">> | !!!Page toolbar -|advanced-search |<> | -|close-all |<> | -|control-panel |<> | -|encryption |<> | -|export-page |<> | -|full-screen |<> | -|home |<> | -|import |<> | -|language |<> | -|more-page-actions |<> | -|new-journal |<> | -|new-tiddler |<> | -|permaview |<> | -|refresh |<> | -|save-wiki |<> | -|storyview |<> | -|tag-manager |<> | -|theme |<> | \ No newline at end of file +|advanced-search |<<.button "advanced-search">> | +|close-all |<<.button "close-all">> | +|control-panel |<<.button "control-panel">> | +|encryption |<<.button "encryption">> | +|export-page |<<.button "export-page">> | +|full-screen |<<.button "full-screen">> | +|home |<<.button "home">> | +|import |<<.button "import">> | +|language |<<.button "language">> | +|more-page-actions |<<.button "more-page-actions">> | +|new-journal |<<.button "new-journal">> | +|new-tiddler |<<.button "new-tiddler">> | +|permaview |<<.button "permaview">> | +|refresh |<<.button "refresh">> | +|save-wiki |<<.button "save-wiki">> | +|storyview |<<.button "storyview">> | +|tag-manager |<<.button "tag-manager">> | +|theme |<<.button "theme">> | diff --git a/editions/tw5.com/tiddlers/styleguide/Documentation Style Guide.tid b/editions/tw5.com/tiddlers/styleguide/Documentation Style Guide.tid index 280ad68a7..c3b4eb85f 100644 --- a/editions/tw5.com/tiddlers/styleguide/Documentation Style Guide.tid +++ b/editions/tw5.com/tiddlers/styleguide/Documentation Style Guide.tid @@ -1,5 +1,5 @@ created: 20140904164608166 -modified: 20150110181800000 +modified: 20150117152546000 title: Documentation Style Guide tags: [[Improving TiddlyWiki Documentation]] type: text/vnd.tiddlywiki @@ -18,4 +18,4 @@ Additional topics: * [[Spelling]] * [[Typography]] * [[Documentation Macros]] -* [[Technical Prose Style]] \ No newline at end of file +* [[Technical Prose Style]] diff --git a/editions/tw5.com/tiddlers/styleguide/Instruction Tiddlers.tid b/editions/tw5.com/tiddlers/styleguide/Instruction Tiddlers.tid index 301b7c21b..c01504e35 100644 --- a/editions/tw5.com/tiddlers/styleguide/Instruction Tiddlers.tid +++ b/editions/tw5.com/tiddlers/styleguide/Instruction Tiddlers.tid @@ -1,9 +1,9 @@ created: 20150110101500000 -modified: 20150110181800000 +modified: 20150117152550000 title: Instruction Tiddlers tags: [[Improving TiddlyWiki Documentation]] -<> talk directly to the reader and guide them through a process. The reader is likely to be a beginner or an intermediate user. +<<.def "Instruction tiddlers">> talk directly to the reader and guide them through a process. The reader is likely to be a beginner or an intermediate user. Such tiddlers can be subcategorised as: @@ -18,7 +18,7 @@ Such tiddlers can be subcategorised as: * An ordered presentation of material for beginners * Each tiddler introduces one new point or concept * Its main content contains very few links -* A revealable <> section at the end can offer related links +* A revealable <<.word "Find out more">> section at the end can offer related links ;Exercise * Accompanying a tutorial tiddler @@ -34,6 +34,6 @@ Such tiddlers can be subcategorised as: * Can contain explanations and similar commentary * Kept separate to keep the reference tiddler pure -Instruction tiddlers talk directly to the reader as <>. They can be reasonably chatty. +Instruction tiddlers talk directly to the reader as <<.word you>>. They can be reasonably chatty. -But they avoid excessively colloquial language, cultural or topical references and attempts at humour, as these can baffle or even offend the international readership. They also avoid potentially frustrating the reader with descriptions of features as <> or <>. +But they avoid excessively colloquial language, cultural or topical references and attempts at humour, as these can baffle or even offend the international readership. They also avoid potentially frustrating the reader with descriptions of features as <<.word convenient>> or <<.word easy>>. diff --git a/editions/tw5.com/tiddlers/styleguide/Reference Tiddlers.tid b/editions/tw5.com/tiddlers/styleguide/Reference Tiddlers.tid index 8c1e5c84f..a42fdbe2e 100644 --- a/editions/tw5.com/tiddlers/styleguide/Reference Tiddlers.tid +++ b/editions/tw5.com/tiddlers/styleguide/Reference Tiddlers.tid @@ -1,9 +1,9 @@ created: 20141226192500000 -modified: 20150110182100000 +modified: 20150117152552000 title: Reference Tiddlers tags: [[Improving TiddlyWiki Documentation]] -<> offer raw information in a comprehensive interlinked way. The reader is likely to be an intermediate or expert user. +<<.def "Reference tiddlers">> offer raw information in a comprehensive interlinked way. The reader is likely to be an intermediate or expert user. There are several subcategories: @@ -19,8 +19,8 @@ There are several subcategories: Reference material is written in a terse, formal style that avoids referring to the reader, and instead focuses on how ~TiddlyWiki itself behaves. The passive voice is often suitable: -* <> rather than <> -* <> rather than <> -* But <> is better, because it is less convoluted and more succinct +* <<.word "the template is specified as a tiddler">> rather than <<.word "specify the template as a tiddler">> +* <<.word "the widget can be used for various purposes">> rather than <<.word "you can use the widget for various purposes">> +* But <<.word "this widget has several possible uses">> is better, because it is less convoluted and more succinct -Most contracted verb forms are avoided in reference tiddlers. But those ending in <> (<>, <>, <>, <>, etc) are acceptable, as they make it less easy to accidentally overlook the word <>. \ No newline at end of file +Most contracted verb forms are avoided in reference tiddlers. But those ending in <<.word "n't">> (<<.word "aren't">>, <<.word "doesn't">>, <<.word "hasn't">>, <<.word "isn't">>, etc) are acceptable, as they make it less easy to accidentally overlook the word <<.word not>>. diff --git a/editions/tw5.com/tiddlers/styleguide/Spelling.tid b/editions/tw5.com/tiddlers/styleguide/Spelling.tid index 020c20738..eceb59962 100644 --- a/editions/tw5.com/tiddlers/styleguide/Spelling.tid +++ b/editions/tw5.com/tiddlers/styleguide/Spelling.tid @@ -1,12 +1,13 @@ created: 20150110182900000 +modified: 20150117152553000 title: Spelling tags: [[Improving TiddlyWiki Documentation]] Because ~TiddlyWiki is of British origin, its English documentation uses [[British spelling in preference to US spelling|http://en.wikipedia.org/wiki/American_and_British_English_spelling_differences]]. -Words like <> are spelled <>, not <>. +Words like <<.word customise>> are spelled <<.word -ise>>, not <<.word -ize>>. -Standard technical acronyms are written in upper case, without dots: <>, not <> or <> +Standard technical acronyms are written in upper case, without dots: <<.word HTML>>, not <<.word html>> or <<.word H.T.M.L.>> Avoid arbitrarily abbreviating words and sentences. But the following abbreviations are acceptable: diff --git a/editions/tw5.com/tiddlers/styleguide/Technical Prose Style.tid b/editions/tw5.com/tiddlers/styleguide/Technical Prose Style.tid index 09022bed4..0d0edc2a3 100644 --- a/editions/tw5.com/tiddlers/styleguide/Technical Prose Style.tid +++ b/editions/tw5.com/tiddlers/styleguide/Technical Prose Style.tid @@ -1,4 +1,5 @@ created: 20150110182900000 +modified: 20150117152555000 title: Technical Prose Style tags: [[Improving TiddlyWiki Documentation]] @@ -6,9 +7,9 @@ When writing an [[instruction tiddler|Instruction Tiddlers]], start by planning Keep sentences short and simple. A clear technical sentence seldom contains more than one idea. It therefore avoids parenthetical information. Similarly, keep paragraph structure simple. A flat presentation is often easier to understand than a hierarchical one. -It is often possible to simplify a sentence without changing its meaning merely by adjusting its vocabulary. <> just means <>. <> just means <>. +It is often possible to simplify a sentence without changing its meaning, merely by adjusting its vocabulary or grammatical structure. <<.word "Execution of the macro is performed">> just means <<.word "The macro runs">>. <<.word "Your expectation might be...">> just means <<.word "You might expect...">>. -Prefer the active voice by default: <> rather than <>. The passive voice can be useful if you want the reader to focus on the action itself or its result: <>. But it may be clearer to proceed from cause to effect and say <> in the active voice. +Prefer the active voice by default: <<.word "Jane creates a tiddler">> rather than <<.word "a tiddler is created by Jane">>. The passive voice can be useful if you want the reader to focus on the action itself or its result: <<.word "a tiddler is created">>. But it can often be clearer to proceed from cause to effect and say <<.word "this creates a tiddler">> in the active voice. Documentation often presents two items that are parallel either by similarity or by difference. The reader will more easily detect such a pattern if you use the same sentence or phrase structure for both. But this must be balanced with the need to avoid monotony. diff --git a/editions/tw5.com/tiddlers/styleguide/Tiddler Structure.tid b/editions/tw5.com/tiddlers/styleguide/Tiddler Structure.tid index ed026cfb1..8e96a87ed 100644 --- a/editions/tw5.com/tiddlers/styleguide/Tiddler Structure.tid +++ b/editions/tw5.com/tiddlers/styleguide/Tiddler Structure.tid @@ -1,4 +1,5 @@ created: 20150110183300000 +modified: 20150117152556000 title: Tiddler Structure tags: [[Improving TiddlyWiki Documentation]] diff --git a/editions/tw5.com/tiddlers/styleguide/Tiddler Title Policy.tid b/editions/tw5.com/tiddlers/styleguide/Tiddler Title Policy.tid index c779704b3..4f9125d37 100644 --- a/editions/tw5.com/tiddlers/styleguide/Tiddler Title Policy.tid +++ b/editions/tw5.com/tiddlers/styleguide/Tiddler Title Policy.tid @@ -1,22 +1,24 @@ created: 20150110183300000 -modified: 20150110190400000 +modified: 20150118183633000 title: Tiddler Title Policy tags: [[Improving TiddlyWiki Documentation]] -Many documentation tiddlers, especially the [[reference ones|Reference Tiddlers]], are concerned with a single concept. Their titles should be succinct noun phrases like <> or <>. +Many documentation tiddlers, especially the [[reference ones|Reference Tiddlers]], are concerned with a single concept. Their titles should be succinct noun phrases like <<.tid "List Widget">> or <<.tid "Tiddler Fields">>. -Each of the main words of such a title begins with a capital letter. Minor words such as <>, <>, <>, <> and <> do not. +Each of the main words of such a title begins with a capital letter. Minor words such as <<.word and>>, <<.word or>>, <<.word the>>, <<.word to>> and <<.word with>> do not. Tags also follow this pattern. -Titles of this kind are plural if they denote a category of items, e.g. <> or <>. Such titles are used to tag more specific tiddlers within the category. +Titles of this kind are plural if they denote a category of items, e.g. <<.tid "Keyboard Shortcuts">> or <<.tid "Tiddler Fields">>. Such titles are used to tag more specific tiddlers within the category. -Where a concept is an item rather than a category, its tiddler has a singular title, e.g. <>, <>. +Where a concept is an item rather than a category, its tiddler has a singular title, e.g. <<.tid "List Widget">>, <<.tid "tag Operator">>. -Avoid starting a title with the word <>. +Start a title with its most distinctive part. For instance, the tiddlers documenting the filter operators have titles like <<.tid "addprefix Operator">>. This helps the reader scan a list of links to find a particular tiddler. -In the past, many tiddlers had CamelCase titles. This is gradually being phased out of the documentation to improve readability. ~CamelCase titles should no longer be used, even for tags, except in cases like <> where that is the standard spelling. +Avoid starting a title with the word <<.word the>>. -[[Instruction tiddlers|Instruction Tiddlers]] often have longer titles that can be more complicated than just a noun phrase, e.g. <> These titles use sentence case, i.e. only the first word (and any proper names) starts with a capital letter. +In the past, many tiddlers had CamelCase titles. This is gradually being phased out of the documentation to improve readability. ~CamelCase titles should no longer be used, even for tags, except in cases like <<.tid ~JavaScript>> where that is the standard spelling. -How-to tiddlers have titles that begin with <>, e.g. <>. Avoid titles like <>, because a less fluent English speaker could misunderstand that as the name of a category of tiddlers. \ No newline at end of file +[[Instruction tiddlers|Instruction Tiddlers]] often have longer titles that can be more complicated than just a noun phrase, e.g. <<.tid "Ten reasons to switch to ~TiddlyWiki">>. These titles use sentence case, i.e. only the first word (and any proper names) starts with a capital letter. + +How-to tiddlers have titles that begin with <<.word "How to">>, e.g. <<.tid "How to edit a tiddler">>. Avoid titles like <<.tid "Editing tiddlers">>, because a less fluent English speaker could misunderstand that as the name of a category of tiddlers. diff --git a/editions/tw5.com/tiddlers/styleguide/Typography.tid b/editions/tw5.com/tiddlers/styleguide/Typography.tid index 4efcd6bb2..05ee65f79 100644 --- a/editions/tw5.com/tiddlers/styleguide/Typography.tid +++ b/editions/tw5.com/tiddlers/styleguide/Typography.tid @@ -1,4 +1,5 @@ created: 20141226192500000 +modified: 20150117152559000 title: Typography tags: documenting @@ -6,7 +7,7 @@ Use the [[documentation macros|Documentation Macros]] to keep the text maintaina Be wary of arbitrarily applying raw bold or italic markup in a sentence. If there's a suitable macro, use that instead. If there isn't a suitable macro, write one or request one. -Use simple backticks (`...`) for fragments of WikiText. +Use simple backticks (`...`) for fragments of WikiText, but not for the names of things like fields and widgets. These have their own macros. To keep things clean and simple, quotation marks and apostrophes should be straight `'`, not curly `’`, and the ellipsis should be three separate dots `...` rather than `…`. diff --git a/editions/tw5.com/tiddlers/system/doc-macros.tid b/editions/tw5.com/tiddlers/system/doc-macros.tid index ba564effc..4d6e840ed 100644 --- a/editions/tw5.com/tiddlers/system/doc-macros.tid +++ b/editions/tw5.com/tiddlers/system/doc-macros.tid @@ -1,38 +1,48 @@ +created: 20150117152607000 +modified: 20150118182742000 title: $:/editions/tw5.com/doc-macros tags: $:/tags/Macro -\define doc-if(cond,then,else) <$reveal type="nomatch" default="$cond$" text="">$then$<$reveal type="match" default="$cond$" text="">$else$ +\define .if(cond,then,else) <$reveal default="$cond$" type="nomatch" text="">$then$<$reveal default="$cond$" type="match" text="">$else$ -\define doc-def(_) $_$ -\define doc-em(_) $_$ -\define doc-strong(_) $_$ -\define doc-ph(_) $_$ -\define doc-w(_) "$_$" +\define .def(_) $_$ +\define .em(_) $_$ +\define .strong(_) $_$ +\define .place(_) $_$ +\define .word(_) "$_$" -\define doc-tiddler(_) $_$ -\define doc-tag(_) $_$ -\define doc-field(_) $_$ -\define doc-field-value(_) $_$ -\define doc-var(_) $_$ -\define doc-widget(_) $_$ +\define .preamble(_) :.doc-preamble $_$ -\define doc-link(_,to) <$link to="$to$">$_$ -\define doc-clink(_,to) <> +\define .tid(_) $_$ +\define .tag(_) $_$ +\define .field(_) $_$ +\define .value(_) $_$ +\define .op(_) $_$ +\define .var(_) $_$ +\define .widget(_) $$_$ -\define doc-key(_) $_$ -\define doc-combo-key(_) <$macrocall $name="doc-if" cond="$_$" then="<>"/> -\define doc-key-combo(1,2,3,4) <><><><><><><> +\define .otitle(_) $_$ Operator -\define doc-input(_) `$_$` -\define doc-output(_) `$_$` +\define .link(_,to) <$link to="$to$">$_$ +\define .clink(_,to) <<.link """$_$""" "$to$">> +\define .flink(to) <$macrocall $name=".link" _="<<.field {{$to$!!caption}}>>" to="$to$"/> +\define .olink(_) <$macrocall $name=".link" _=<<.op "$_$">> to=<<.otitle "$_$">>/> +\define .olink2(_,to) <$macrocall $name=".link" _=<<.op "$_$">> to=<<.otitle "$to$">>/> +\define .wlink(to) <$macrocall $name=".link" _="<<.wid {{$to$!!caption}}>>" to="$to$"/> -\define doc-tab(_) {{$_$!!caption}} -\define doc-sidebar-tab(_) <> -\define doc-more-tab(_) <> -\define doc-info-tab(_) <> -\define doc-controlpanel-tab(_) <> -\define doc-advancedsearch-tab(_) <> -\define doc-toc-tab() <> -\define doc-example-tab(_) $_$ +\define .key(_) $_$ +\define .combokey(_) <$macrocall $name=".if" cond="$_$" then="<<.key '$_$'>>"/> +\define .keycombo(1,2,3,4) <<.combokey "$1$">><<.if "$2$" +>><<.combokey "$2$">><<.if "$3$" +>><<.combokey "$3$">><<.if "$4$" +>><<.combokey "$4$">> -\define doc-button(_) {{$:/core/ui/Buttons/$_$!!caption}} +\define .tab(_) {{$_$!!caption}} +\define .sidebar-tab(_) <<.tab "$:/core/ui/SideBar/$_$">> +\define .more-tab(_) <<.tab "$:/core/ui/MoreSideBar/$_$">> +\define .info-tab(_) <<.tab "$:/core/ui/TiddlerInfo/$_$">> +\define .controlpanel-tab(_) <<.tab "$:/core/ui/ControlPanel/$_$">> +\define .advancedsearch-tab(_) <<.tab "$:/core/ui/AdvancedSearch/$_$">> +\define .toc-tab() <<.tab "TableOfContents">> +\define .example-tab(_) $_$ + +\define .button(_) {{$:/core/ui/Buttons/$_$!!caption}} + +\define .state-prefix() $:/state/editions/tw5.com/ diff --git a/editions/tw5.com/tiddlers/system/doc-styles.tid b/editions/tw5.com/tiddlers/system/doc-styles.tid index 658f1f02a..4e55d04a8 100644 --- a/editions/tw5.com/tiddlers/system/doc-styles.tid +++ b/editions/tw5.com/tiddlers/system/doc-styles.tid @@ -1,3 +1,5 @@ +created: 20150117152612000 +modified: 20150118161750000 title: $:/editions/tw5.com/doc-styles tags: $:/tags/Stylesheet @@ -22,7 +24,8 @@ tags: $:/tags/Stylesheet font-style: italic; } -.doc-ph { +.doc-place { + background-color: <>; border: none; color: <>; font-style: italic; @@ -33,20 +36,38 @@ tags: $:/tags/Stylesheet .doc-tag, .doc-tiddler, .doc-field, -.doc-field-value, +.doc-value, +.doc-operator, .doc-var, .doc-widget { - background: <>; + background-color: <>; border: none; color: <>; font-weight: bold; padding: 0; } +a .doc-place, +a .doc-button, +a .doc-tab, +a .doc-tag, +a .doc-tiddler, +a .doc-field, +a .doc-value, +a .doc-operator, +a .doc-var, +a .doc-widget { + color: <>; +} + .doc-button svg { height: 1em; } +td svg { + height: 1em; +} + .doc-key { color: <>; font-weight: bold; @@ -54,4 +75,25 @@ tags: $:/tags/Stylesheet .doc-clink code { color: <>; -} \ No newline at end of file +} + +.doc-preamble { + border: 2px solid <>; + color: <>; + font-size: 90%; + margin-left: 0; + padding: 0.5em 0.7em; +} + +.doc-example { + margin: 1em 0; + padding: 0.8em 0; +} +.doc-example:hover { + background-color: <>; +} +.doc-example ul { + margin-bottom: 0; + padding-bottom: 0; + margin-top: 0.2em; +} diff --git a/editions/tw5.com/tiddlers/system/operator-macros.tid b/editions/tw5.com/tiddlers/system/operator-macros.tid new file mode 100644 index 000000000..30e281cd5 --- /dev/null +++ b/editions/tw5.com/tiddlers/system/operator-macros.tid @@ -0,0 +1,60 @@ +created: 20150117152607000 +modified: 20150118181923000 +title: $:/editions/tw5.com/operator-macros +tags: $:/tags/Macro + +\define .operator-def(input,parameter,paramName,output) + + + + + + + + + +
input$input$
parameter <<.place "$paramName$">>$parameter$
output$output$
+\end + +\define .operator-def-suffix(input,suffix,suffixName,parameter,paramName,output) + + + + + + + + + + + + +
input$input$
suffix <<.place "$suffixName$">>$suffix$
parameter <<.place "$paramName$">>$parameter$
output$output$
+\end + +\define .operator-examples(op) <$link to="$op$ Operator (Examples)">Examples + +\define .operator-example(n,eg,ie) +
+`$eg$` +<<.if cond:"$ie$" then:"
i.e. $ie$
">> +<$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix[$n$]]" variable=".state"> + <$reveal state=<<.state>> type="nomatch" text="show"> +
+
<$button set=<<.state>> setTo="show">Try it
+
+ + <$reveal state=<<.state>> type="match" text="show"> +
+
<$button set=<<.state>> setTo="">Hide
+
+
    <$list filter="$eg$" emptyMessage="(empty)"> +
  • <$link><$view field="title"/>
  • +
+ + +\end + +\define .this-is-operator-example() This example tiddler is used to illustrate some of the [[Filter Operators]]. +\define .using-days-of-week() These examples make use of the [[Days of the Week]] tiddler. +\define .node-only-operator() This operator is <<.em not>> available when ~TiddlyWiki is running in a web browser. diff --git a/editions/tw5.com/tiddlers/system/wikitext-macros.tid b/editions/tw5.com/tiddlers/system/wikitext-macros.tid index 8a0fe87c4..932ff581d 100644 --- a/editions/tw5.com/tiddlers/system/wikitext-macros.tid +++ b/editions/tw5.com/tiddlers/system/wikitext-macros.tid @@ -1,32 +1,38 @@ +created: 20150117184156000 +modified: 20150117184616000 title: $:/editions/tw5.com/wikitext-macros tags: $:/tags/Macro \define wikitext-example(src) +
+ ``` $src$ ``` -Renders as: +That renders as: $src$ -In HTML: +... and the underlying HTML is: $$$text/vnd.tiddlywiki>text/html $src$ $$$ - +
\end \define wikitext-example-without-html(src) +
+ ``` $src$ ``` -Renders as: +That renders as: $src$ - +
\end \define tw-code(tiddler) diff --git a/editions/tw5.com/tiddlers/wikitext/Variables in WikiText.tid b/editions/tw5.com/tiddlers/wikitext/Variables in WikiText.tid index 0fbf685c8..90dc422d3 100644 --- a/editions/tw5.com/tiddlers/wikitext/Variables in WikiText.tid +++ b/editions/tw5.com/tiddlers/wikitext/Variables in WikiText.tid @@ -1,6 +1,6 @@ caption: Variables created: 20141002141231992 -modified: 20150107121000000 +modified: 20150117152625000 tags: WikiText title: Variables in WikiText type: text/vnd.tiddlywiki @@ -68,7 +68,7 @@ Below, the `\define` pragma at the beginning of a tiddler [[defines the macro|Ma ''using a filter variable to get all incoming links'' -Using the [[backlinks|FilterOperator: backlinks]] [[filter operator|FilterOperators]] to get all tiddlers linking to this one... +Using the <> [[filter operator|Filter Operators]] to get all tiddlers linking to this one... ``` <backlinks[]]">> @@ -76,4 +76,4 @@ Using the [[backlinks|FilterOperator: backlinks]] [[filter operator|FilterOperat <<< <backlinks[]]">> -<<< \ No newline at end of file +<<< From 9bd3fb7238897ed765d230c4d687c4a789ce8a10 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Sun, 18 Jan 2015 19:20:02 +0000 Subject: [PATCH 04/10] Rename filter operator .tid files --- .../filters/{FilterOperator addprefix.tid => addprefix.tid} | 0 .../filters/{FilterOperator addsuffix.tid => addsuffix.tid} | 0 .../tiddlers/filters/{FilterOperator after.tid => after.tid} | 0 .../tw5.com/tiddlers/filters/{FilterOperator all.tid => all.tid} | 0 .../filters/{FilterOperator backlinks.tid => backlinks.tid} | 0 .../tiddlers/filters/{FilterOperator before.tid => before.tid} | 0 .../tw5.com/tiddlers/filters/{FilterOperator bf.tid => bf.tid} | 0 .../filters/{FilterOperator butfirst.tid => butfirst.tid} | 0 .../tiddlers/filters/{FilterOperator butlast.tid => butlast.tid} | 0 .../filters/{FilterOperator commands.tid => commands.tid} | 0 .../tiddlers/filters/{FilterOperator each.tid => each.tid} | 0 .../tiddlers/filters/{FilterOperator eachday.tid => eachday.tid} | 0 ...lterOperator editiondescription.tid => editiondescription.tid} | 0 .../filters/{FilterOperator editions.tid => editions.tid} | 0 .../tiddlers/filters/{FilterOperator field.tid => field.tid} | 0 .../tiddlers/filters/{FilterOperator fields.tid => fields.tid} | 0 .../tiddlers/filters/{FilterOperator first.tid => first.tid} | 0 .../tw5.com/tiddlers/filters/{FilterOperator get.tid => get.tid} | 0 .../tw5.com/tiddlers/filters/{FilterOperator has.tid => has.tid} | 0 .../tiddlers/filters/{FilterOperator indexes.tid => indexes.tid} | 0 .../tw5.com/tiddlers/filters/{FilterOperator is.tid => is.tid} | 0 .../tiddlers/filters/{FilterOperator last.tid => last.tid} | 0 .../tiddlers/filters/{FilterOperator limit.tid => limit.tid} | 0 .../tiddlers/filters/{FilterOperator links.tid => links.tid} | 0 .../tiddlers/filters/{FilterOperator list.tid => list.tid} | 0 .../tiddlers/filters/{FilterOperator listed.tid => listed.tid} | 0 .../tiddlers/filters/{FilterOperator modules.tid => modules.tid} | 0 .../filters/{FilterOperator moduletypes.tid => moduletypes.tid} | 0 .../tiddlers/filters/{FilterOperator next.tid => next.tid} | 0 .../tiddlers/filters/{FilterOperator nsort.tid => nsort.tid} | 0 .../tiddlers/filters/{FilterOperator nsortcs.tid => nsortcs.tid} | 0 .../tw5.com/tiddlers/filters/{FilterOperator nth.tid => nth.tid} | 0 .../{FilterOperator plugintiddlers.tid => plugintiddlers.tid} | 0 .../tiddlers/filters/{FilterOperator prefix.tid => prefix.tid} | 0 .../filters/{FilterOperator previous.tid => previous.tid} | 0 .../tiddlers/filters/{FilterOperator regexp.tid => regexp.tid} | 0 .../filters/{FilterOperator removeprefix.tid => removeprefix.tid} | 0 .../filters/{FilterOperator removesuffix.tid => removesuffix.tid} | 0 .../tiddlers/filters/{FilterOperator rest.tid => rest.tid} | 0 .../tiddlers/filters/{FilterOperator reverse.tid => reverse.tid} | 0 .../tiddlers/filters/{FilterOperator sameday.tid => sameday.tid} | 0 .../tiddlers/filters/{FilterOperator search.tid => search.tid} | 0 .../filters/{FilterOperator shadowsource.tid => shadowsource.tid} | 0 .../tiddlers/filters/{FilterOperator sort.tid => sort.tid} | 0 .../tiddlers/filters/{FilterOperator sortcs.tid => sortcs.tid} | 0 .../tiddlers/filters/{FilterOperator suffix.tid => suffix.tid} | 0 .../tw5.com/tiddlers/filters/{FilterOperator tag.tid => tag.tid} | 0 .../tiddlers/filters/{FilterOperator tagging.tid => tagging.tid} | 0 .../tiddlers/filters/{FilterOperator tags.tid => tags.tid} | 0 .../tiddlers/filters/{FilterOperator title.tid => title.tid} | 0 .../filters/{FilterOperator untagged.tid => untagged.tid} | 0 51 files changed, 0 insertions(+), 0 deletions(-) rename editions/tw5.com/tiddlers/filters/{FilterOperator addprefix.tid => addprefix.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator addsuffix.tid => addsuffix.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator after.tid => after.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator all.tid => all.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator backlinks.tid => backlinks.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator before.tid => before.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator bf.tid => bf.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator butfirst.tid => butfirst.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator butlast.tid => butlast.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator commands.tid => commands.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator each.tid => each.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator eachday.tid => eachday.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator editiondescription.tid => editiondescription.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator editions.tid => editions.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator field.tid => field.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator fields.tid => fields.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator first.tid => first.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator get.tid => get.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator has.tid => has.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator indexes.tid => indexes.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator is.tid => is.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator last.tid => last.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator limit.tid => limit.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator links.tid => links.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator list.tid => list.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator listed.tid => listed.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator modules.tid => modules.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator moduletypes.tid => moduletypes.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator next.tid => next.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator nsort.tid => nsort.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator nsortcs.tid => nsortcs.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator nth.tid => nth.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator plugintiddlers.tid => plugintiddlers.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator prefix.tid => prefix.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator previous.tid => previous.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator regexp.tid => regexp.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator removeprefix.tid => removeprefix.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator removesuffix.tid => removesuffix.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator rest.tid => rest.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator reverse.tid => reverse.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator sameday.tid => sameday.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator search.tid => search.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator shadowsource.tid => shadowsource.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator sort.tid => sort.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator sortcs.tid => sortcs.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator suffix.tid => suffix.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator tag.tid => tag.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator tagging.tid => tagging.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator tags.tid => tags.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator title.tid => title.tid} (100%) rename editions/tw5.com/tiddlers/filters/{FilterOperator untagged.tid => untagged.tid} (100%) diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator addprefix.tid b/editions/tw5.com/tiddlers/filters/addprefix.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator addprefix.tid rename to editions/tw5.com/tiddlers/filters/addprefix.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator addsuffix.tid b/editions/tw5.com/tiddlers/filters/addsuffix.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator addsuffix.tid rename to editions/tw5.com/tiddlers/filters/addsuffix.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator after.tid b/editions/tw5.com/tiddlers/filters/after.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator after.tid rename to editions/tw5.com/tiddlers/filters/after.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator all.tid b/editions/tw5.com/tiddlers/filters/all.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator all.tid rename to editions/tw5.com/tiddlers/filters/all.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator backlinks.tid b/editions/tw5.com/tiddlers/filters/backlinks.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator backlinks.tid rename to editions/tw5.com/tiddlers/filters/backlinks.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator before.tid b/editions/tw5.com/tiddlers/filters/before.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator before.tid rename to editions/tw5.com/tiddlers/filters/before.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator bf.tid b/editions/tw5.com/tiddlers/filters/bf.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator bf.tid rename to editions/tw5.com/tiddlers/filters/bf.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator butfirst.tid b/editions/tw5.com/tiddlers/filters/butfirst.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator butfirst.tid rename to editions/tw5.com/tiddlers/filters/butfirst.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator butlast.tid b/editions/tw5.com/tiddlers/filters/butlast.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator butlast.tid rename to editions/tw5.com/tiddlers/filters/butlast.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator commands.tid b/editions/tw5.com/tiddlers/filters/commands.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator commands.tid rename to editions/tw5.com/tiddlers/filters/commands.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator each.tid b/editions/tw5.com/tiddlers/filters/each.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator each.tid rename to editions/tw5.com/tiddlers/filters/each.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator eachday.tid b/editions/tw5.com/tiddlers/filters/eachday.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator eachday.tid rename to editions/tw5.com/tiddlers/filters/eachday.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator editiondescription.tid b/editions/tw5.com/tiddlers/filters/editiondescription.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator editiondescription.tid rename to editions/tw5.com/tiddlers/filters/editiondescription.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator editions.tid b/editions/tw5.com/tiddlers/filters/editions.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator editions.tid rename to editions/tw5.com/tiddlers/filters/editions.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator field.tid b/editions/tw5.com/tiddlers/filters/field.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator field.tid rename to editions/tw5.com/tiddlers/filters/field.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator fields.tid b/editions/tw5.com/tiddlers/filters/fields.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator fields.tid rename to editions/tw5.com/tiddlers/filters/fields.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator first.tid b/editions/tw5.com/tiddlers/filters/first.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator first.tid rename to editions/tw5.com/tiddlers/filters/first.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator get.tid b/editions/tw5.com/tiddlers/filters/get.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator get.tid rename to editions/tw5.com/tiddlers/filters/get.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator has.tid b/editions/tw5.com/tiddlers/filters/has.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator has.tid rename to editions/tw5.com/tiddlers/filters/has.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator indexes.tid b/editions/tw5.com/tiddlers/filters/indexes.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator indexes.tid rename to editions/tw5.com/tiddlers/filters/indexes.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator is.tid b/editions/tw5.com/tiddlers/filters/is.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator is.tid rename to editions/tw5.com/tiddlers/filters/is.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator last.tid b/editions/tw5.com/tiddlers/filters/last.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator last.tid rename to editions/tw5.com/tiddlers/filters/last.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator limit.tid b/editions/tw5.com/tiddlers/filters/limit.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator limit.tid rename to editions/tw5.com/tiddlers/filters/limit.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator links.tid b/editions/tw5.com/tiddlers/filters/links.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator links.tid rename to editions/tw5.com/tiddlers/filters/links.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator list.tid b/editions/tw5.com/tiddlers/filters/list.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator list.tid rename to editions/tw5.com/tiddlers/filters/list.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator listed.tid b/editions/tw5.com/tiddlers/filters/listed.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator listed.tid rename to editions/tw5.com/tiddlers/filters/listed.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator modules.tid b/editions/tw5.com/tiddlers/filters/modules.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator modules.tid rename to editions/tw5.com/tiddlers/filters/modules.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator moduletypes.tid b/editions/tw5.com/tiddlers/filters/moduletypes.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator moduletypes.tid rename to editions/tw5.com/tiddlers/filters/moduletypes.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator next.tid b/editions/tw5.com/tiddlers/filters/next.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator next.tid rename to editions/tw5.com/tiddlers/filters/next.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator nsort.tid b/editions/tw5.com/tiddlers/filters/nsort.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator nsort.tid rename to editions/tw5.com/tiddlers/filters/nsort.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator nsortcs.tid b/editions/tw5.com/tiddlers/filters/nsortcs.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator nsortcs.tid rename to editions/tw5.com/tiddlers/filters/nsortcs.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator nth.tid b/editions/tw5.com/tiddlers/filters/nth.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator nth.tid rename to editions/tw5.com/tiddlers/filters/nth.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator plugintiddlers.tid b/editions/tw5.com/tiddlers/filters/plugintiddlers.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator plugintiddlers.tid rename to editions/tw5.com/tiddlers/filters/plugintiddlers.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator prefix.tid b/editions/tw5.com/tiddlers/filters/prefix.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator prefix.tid rename to editions/tw5.com/tiddlers/filters/prefix.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator previous.tid b/editions/tw5.com/tiddlers/filters/previous.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator previous.tid rename to editions/tw5.com/tiddlers/filters/previous.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator regexp.tid b/editions/tw5.com/tiddlers/filters/regexp.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator regexp.tid rename to editions/tw5.com/tiddlers/filters/regexp.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator removeprefix.tid b/editions/tw5.com/tiddlers/filters/removeprefix.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator removeprefix.tid rename to editions/tw5.com/tiddlers/filters/removeprefix.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator removesuffix.tid b/editions/tw5.com/tiddlers/filters/removesuffix.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator removesuffix.tid rename to editions/tw5.com/tiddlers/filters/removesuffix.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator rest.tid b/editions/tw5.com/tiddlers/filters/rest.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator rest.tid rename to editions/tw5.com/tiddlers/filters/rest.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator reverse.tid b/editions/tw5.com/tiddlers/filters/reverse.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator reverse.tid rename to editions/tw5.com/tiddlers/filters/reverse.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator sameday.tid b/editions/tw5.com/tiddlers/filters/sameday.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator sameday.tid rename to editions/tw5.com/tiddlers/filters/sameday.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator search.tid b/editions/tw5.com/tiddlers/filters/search.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator search.tid rename to editions/tw5.com/tiddlers/filters/search.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator shadowsource.tid b/editions/tw5.com/tiddlers/filters/shadowsource.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator shadowsource.tid rename to editions/tw5.com/tiddlers/filters/shadowsource.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator sort.tid b/editions/tw5.com/tiddlers/filters/sort.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator sort.tid rename to editions/tw5.com/tiddlers/filters/sort.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator sortcs.tid b/editions/tw5.com/tiddlers/filters/sortcs.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator sortcs.tid rename to editions/tw5.com/tiddlers/filters/sortcs.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator suffix.tid b/editions/tw5.com/tiddlers/filters/suffix.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator suffix.tid rename to editions/tw5.com/tiddlers/filters/suffix.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator tag.tid b/editions/tw5.com/tiddlers/filters/tag.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator tag.tid rename to editions/tw5.com/tiddlers/filters/tag.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator tagging.tid b/editions/tw5.com/tiddlers/filters/tagging.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator tagging.tid rename to editions/tw5.com/tiddlers/filters/tagging.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator tags.tid b/editions/tw5.com/tiddlers/filters/tags.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator tags.tid rename to editions/tw5.com/tiddlers/filters/tags.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator title.tid b/editions/tw5.com/tiddlers/filters/title.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator title.tid rename to editions/tw5.com/tiddlers/filters/title.tid diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator untagged.tid b/editions/tw5.com/tiddlers/filters/untagged.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/FilterOperator untagged.tid rename to editions/tw5.com/tiddlers/filters/untagged.tid From ade1c40911db272d5d43122d933afba142db4e21 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Mon, 19 Jan 2015 19:37:26 +0000 Subject: [PATCH 05/10] Revise terminology around tiddler sets --- .../tiddlers/concepts/AbsoluteOperators.tid | 6 +-- .../tiddlers/concepts/DominantAppend.tid | 6 +-- .../tiddlers/concepts/FilterParameters.tid | 4 +- .../tw5.com/tiddlers/concepts/Filters.tid | 4 +- .../tw5.com/tiddlers/concepts/TiddlerSets.tid | 10 ---- .../tw5.com/tiddlers/concepts/TitleList.tid | 8 +-- .../tiddlers/concepts/TitleSelections.tid | 10 ++++ .../tw5.com/tiddlers/fields/ListField.tid | 4 +- .../tiddlers/filters/FilterOperators.tid | 6 +-- .../tw5.com/tiddlers/filters/FilterSyntax.tid | 10 ++-- .../tw5.com/tiddlers/filters/addprefix.tid | 16 +++--- .../tw5.com/tiddlers/filters/addsuffix.tid | 16 +++--- editions/tw5.com/tiddlers/filters/after.tid | 12 ++--- editions/tw5.com/tiddlers/filters/all.tid | 22 ++++---- .../tw5.com/tiddlers/filters/backlinks.tid | 6 +-- editions/tw5.com/tiddlers/filters/before.tid | 12 ++--- editions/tw5.com/tiddlers/filters/butlast.tid | 8 +-- .../tw5.com/tiddlers/filters/commands.tid | 4 +- editions/tw5.com/tiddlers/filters/each.tid | 6 +-- editions/tw5.com/tiddlers/filters/eachday.tid | 8 +-- .../tiddlers/filters/editiondescription.tid | 6 ++- .../tiddlers/filters/examples/indexes.tid | 8 +++ .../tw5.com/tiddlers/filters/examples/is.tid | 13 +++++ .../tiddlers/filters/examples/last.tid | 11 ++++ editions/tw5.com/tiddlers/filters/field.tid | 8 +-- editions/tw5.com/tiddlers/filters/fields.tid | 8 +-- editions/tw5.com/tiddlers/filters/first.tid | 8 +-- editions/tw5.com/tiddlers/filters/get.tid | 4 +- editions/tw5.com/tiddlers/filters/has.tid | 6 +-- editions/tw5.com/tiddlers/filters/indexes.tid | 23 +++++---- editions/tw5.com/tiddlers/filters/is.tid | 50 +++++++++++-------- editions/tw5.com/tiddlers/filters/last.tid | 22 ++++---- editions/tw5.com/tiddlers/howtos/Tagging.tid | 4 +- .../tiddlers/system/operator-macros.tid | 10 ++-- .../Creating journal tiddlers.tid | 4 +- 35 files changed, 207 insertions(+), 156 deletions(-) delete mode 100644 editions/tw5.com/tiddlers/concepts/TiddlerSets.tid create mode 100644 editions/tw5.com/tiddlers/concepts/TitleSelections.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/indexes.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/is.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/last.tid diff --git a/editions/tw5.com/tiddlers/concepts/AbsoluteOperators.tid b/editions/tw5.com/tiddlers/concepts/AbsoluteOperators.tid index 4c097d8f4..161c63691 100644 --- a/editions/tw5.com/tiddlers/concepts/AbsoluteOperators.tid +++ b/editions/tw5.com/tiddlers/concepts/AbsoluteOperators.tid @@ -1,11 +1,11 @@ created: 20150117204109000 -modified: 20150117204242000 +modified: 20150119190116000 tags: Concepts title: Absolute Operators type: text/vnd.tiddlywiki The output of a filter step depends on its [[operator|Filter Operators]]: -* Most operators perform <<.def relative>> to their input. They examine each input string in turn and filter out any that don't match. Such steps narrow down the output of a run. +* Most operators perform <<.def relative>> to their input. They examine each input title in turn and filter out any that don't match. Such steps narrow down the output of a run. -* <<.def Absolute>> operators ignore their input and generate an independent output instead. <<.olink title>> is an example: the result of `[title[A]title[B]]` is `B`. But the <<.olink field>> operator is relative, so the result of `[title[A]field:title[B]` is empty. \ No newline at end of file +* <<.def Absolute>> operators ignore their input and generate an independent output instead. <<.olink title>> is an example: the result of `[title[A]title[B]]` is `B`. But the <<.olink field>> operator is relative, so the result of `[title[A]field:title[B]` is empty. diff --git a/editions/tw5.com/tiddlers/concepts/DominantAppend.tid b/editions/tw5.com/tiddlers/concepts/DominantAppend.tid index 4b4bb9e3b..996cf9cf6 100644 --- a/editions/tw5.com/tiddlers/concepts/DominantAppend.tid +++ b/editions/tw5.com/tiddlers/concepts/DominantAppend.tid @@ -1,11 +1,11 @@ created: 20151714300000000 -modified: 20150117172438000 +modified: 20150119191515000 tags: Concepts title: Dominant Append type: text/vnd.tiddlywiki A <<.def "dominant append">> is a frequent occurrence in [[filter|Filters]] processing. -Filters manipulate sets of items in which no item can appear more than once, and they often append one such set to another. +Filters manipulate [[selections|Title Selections]] in which no title can appear more than once, and they often append one selection to another. -This is done in such a way that if the result would contain two copies of the same item, the <<.em earlier>> one is removed. The appended items thus dominate over any earlier duplicates. +This is done in such a way that if the result would contain two copies of the same title, the <<.em earlier>> one is removed. The appended titles thus dominate over any earlier duplicates. diff --git a/editions/tw5.com/tiddlers/concepts/FilterParameters.tid b/editions/tw5.com/tiddlers/concepts/FilterParameters.tid index f6e08ef4b..5bb828548 100644 --- a/editions/tw5.com/tiddlers/concepts/FilterParameters.tid +++ b/editions/tw5.com/tiddlers/concepts/FilterParameters.tid @@ -1,5 +1,5 @@ created: 20151714300000000 -modified: 20150117193508000 +modified: 20150119185917000 tags: Concepts title: Filter Parameters type: text/vnd.tiddlywiki @@ -12,7 +12,7 @@ The parameter to a [[filter operator|Filter Operators]] can be: ;<<.def indirect>> :<<.def transcluded>> :: `{like this}` -:: The value of a field of a specified tiddler, or the value of an index of a specified [[data tiddler|DataTiddlers]] +:: The value of a field of a specified tiddler, or the value of a property of a specified [[data tiddler|DataTiddlers]] :<<.def variable>> ::`` :: The value of the specified [[variable|Variables]] diff --git a/editions/tw5.com/tiddlers/concepts/Filters.tid b/editions/tw5.com/tiddlers/concepts/Filters.tid index 988ad840d..9bc5ed6bc 100644 --- a/editions/tw5.com/tiddlers/concepts/Filters.tid +++ b/editions/tw5.com/tiddlers/concepts/Filters.tid @@ -1,5 +1,5 @@ created: 20130827080000000 -modified: 20150117193502000 +modified: 20150119191522000 tags: Reference Concepts title: Filters type: text/vnd.tiddlywiki @@ -7,7 +7,7 @@ list: [[Introduction to filter notation]] [[Filter Syntax]] You can think of TiddlyWiki as a database in which the records are tiddlers. A database typically provides a way of discovering which records match a given pattern, and in ~TiddlyWiki this is done with filters. -A <<.def filter>> is a concise notation for selecting a particular [[set of tiddlers|Tiddler Sets]], known as its <<.def "output">>. Whenever ~TiddlyWiki encounters a filter, it calculates the output. Further work can then be done with just those tiddlers, such as [[counting|CountWidget]] or [[listing|ListWidget]] them. +A <<.def filter>> is a concise notation for selecting a particular [[set of tiddlers|Title Selections]], known as its <<.def "output">>. Whenever ~TiddlyWiki encounters a filter, it calculates the output. Further work can then be done with just those tiddlers, such as [[counting|CountWidget]] or [[listing|ListWidget]] them. The following example passes a filter to the [[list-links macro|ListMacro]] to display a list of all tiddlers whose titles start with the letter H: diff --git a/editions/tw5.com/tiddlers/concepts/TiddlerSets.tid b/editions/tw5.com/tiddlers/concepts/TiddlerSets.tid deleted file mode 100644 index bac6c370f..000000000 --- a/editions/tw5.com/tiddlers/concepts/TiddlerSets.tid +++ /dev/null @@ -1,10 +0,0 @@ -created: 20150117152418000 -modified: 20150117165517000 -tags: Concepts -title: Tiddler Sets - -A <<.def "tiddler set">> is a data structure. It is an ordered collection of strings, usually tiddler titles, containing no duplicates. - -Tiddler sets are important in [[filter|Filters]] processing. - -The simplest way to generate one is to use the TitleList syntax. diff --git a/editions/tw5.com/tiddlers/concepts/TitleList.tid b/editions/tw5.com/tiddlers/concepts/TitleList.tid index 7c595da47..db459af15 100644 --- a/editions/tw5.com/tiddlers/concepts/TitleList.tid +++ b/editions/tw5.com/tiddlers/concepts/TitleList.tid @@ -1,9 +1,9 @@ created: 20150117152418000 -modified: 20150117163928000 +modified: 20150119191533000 tags: Concepts -title: TitleList +title: Title Lists -A <<.def "title list">> is a line of text that presents one or more tiddler titles, strung together with a space between each one and the next. +A <<.def "title list">> is a line of text that contians one or more tiddler titles, strung together with a space between each one and the next. If a title <<.em contains>> a space, it needs double square brackets around it: @@ -11,4 +11,4 @@ If a title <<.em contains>> a space, it needs double square brackets around it: Title lists are used in various places, including PermaLinks and the ListField. -They are in fact the simplest case of a [[filter|Filters]]. +They are in fact the simplest case of a [[filter|Filters]], and are thus a way of expressing a [[title selection|Title Selections]]. diff --git a/editions/tw5.com/tiddlers/concepts/TitleSelections.tid b/editions/tw5.com/tiddlers/concepts/TitleSelections.tid new file mode 100644 index 000000000..dee8a89e6 --- /dev/null +++ b/editions/tw5.com/tiddlers/concepts/TitleSelections.tid @@ -0,0 +1,10 @@ +created: 20150117152418000 +modified: 20150119191302000 +tags: Concepts +title: Title Selections + +A <<.def "title selection">> is an ordered set of tiddler titles (or similar strings), in which no title appears more than once. + +Title selections are important in [[filter|Filters]] processing. + +The simplest way to write one down is as a [[title list|Title Lists]]. diff --git a/editions/tw5.com/tiddlers/fields/ListField.tid b/editions/tw5.com/tiddlers/fields/ListField.tid index 511f83e0a..91eb5b17c 100644 --- a/editions/tw5.com/tiddlers/fields/ListField.tid +++ b/editions/tw5.com/tiddlers/fields/ListField.tid @@ -1,11 +1,11 @@ created: 20130830092500000 -modified: 20150117163423000 +modified: 20150119191334000 tags: Fields title: ListField caption: list type: text/vnd.tiddlywiki -The `list` [[field of a tiddler|TiddlerFields]] is an optional feature that can be used to help structure your content. It is defined as an [[ordered sequence of tiddler titles|TitleList]], and it can be used in several ways: +The `list` [[field of a tiddler|TiddlerFields]] is an optional feature that can be used to help structure your content. Its value is a [[title list|Title Lists]], and it can be used in several ways: * The `list` field of a tiddler that is being used as a tag determines the ordering of the tiddlers that carry that tag - see [[Tagging]] for details * The `list` [[filter|Filters]] selects the entries from a list diff --git a/editions/tw5.com/tiddlers/filters/FilterOperators.tid b/editions/tw5.com/tiddlers/filters/FilterOperators.tid index b81cb949c..b192bf5e0 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperators.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperators.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20150118180311000 +modified: 20150119190404000 tags: Concepts Filters title: Filter Operators type: text/vnd.tiddlywiki @@ -12,7 +12,7 @@ A <<.def "filter operator">> is a predefined name attached to an individual step Purpose Common -<$list filter="[tag[Filter Operators]]"> +<$list filter="[tag[Filter Operators]sort[]]"> <$link to={{!!title}}>{{!!caption}} {{!!purpose}} <$list filter="[all[current]tag[Common Operators]]">{{$:/core/images/done-button}} @@ -21,4 +21,4 @@ A <<.def "filter operator">> is a predefined name attached to an individual step A typical step is written as `[operator[parameter]]`, although not all of the operators need a [[parameter|Filter Parameters]]. -Most steps operate on a set of input items. For the exact rules, see [[Filter Syntax]]. +Most steps accept a [[selection|Selection]] of tiddler titles as their input. For the exact rules, see [[Filter Syntax]]. diff --git a/editions/tw5.com/tiddlers/filters/FilterSyntax.tid b/editions/tw5.com/tiddlers/filters/FilterSyntax.tid index 09c3e1126..5f49ad6e3 100644 --- a/editions/tw5.com/tiddlers/filters/FilterSyntax.tid +++ b/editions/tw5.com/tiddlers/filters/FilterSyntax.tid @@ -1,12 +1,12 @@ created: 20140210141217955 -modified: 20150117204215000 +modified: 20150119191956000 tags: Filters title: Filter Syntax type: text/vnd.tiddlywiki <<.preamble """[[Filters]] follow a grammar that is presented here, using [[RailroadDiagrams]], for those who find formal syntax descriptions helpful. However, you can [[learn to write filters|Introduction to filter notation]] without needing to understand this tiddler.""">> -A <<.def filter>> is a pipeline for transforming an <<.def input>> into an <<.def output>>. Both the input and the output are [[ordered sets|Tiddler Sets]] of strings, usually tiddler titles. +A <<.def filter>> is a pipeline for transforming an <<.def input>> into an <<.def output>>. Both the input and the output are [[ordered sets|Title Selections]] of tiddler titles or similar strings. Filters are built from smaller pieces, called ''runs'' and ''steps'', each of which also transforms an input to an output. @@ -19,10 +19,10 @@ Filters are built from smaller pieces, called ''runs'' and ''steps'', each of wh A filter starts with an empty output. Its runs are processed from left to right, progressively modifying the output. -A run's input is normally the set of all tiddler titles in the wiki (in no particular order), but the `+` prefix can change this. +A run's input is normally a list of all the non-shadow tiddler titles in the wiki (in no particular order). But the `+` prefix can change this. -* If a run has no `+` or `-` prefix, its output strings are [[dominantly appended|Dominant Append]] to the filter's output. -* If a run has a `-` prefix, its output strings are <<.em removed>> from the filter's output (if they were present). +* If a run has no `+` or `-` prefix, its output titles are [[dominantly appended|Dominant Append]] to the filter's output. +* If a run has a `-` prefix, its output titles are <<.em removed>> from the filter's output (if they were present). * If a run has a `+` prefix, it receives the filter's output so far as its input. The filter's output is then completely <<.em replaced>> by the run's output. Any subsequent run reverts to receiving all tiddler titles as its input, unless it too has a `+` prefix. In concise technical terms: diff --git a/editions/tw5.com/tiddlers/filters/addprefix.tid b/editions/tw5.com/tiddlers/filters/addprefix.tid index 5b692b951..f06ca4ca0 100644 --- a/editions/tw5.com/tiddlers/filters/addprefix.tid +++ b/editions/tw5.com/tiddlers/filters/addprefix.tid @@ -1,16 +1,16 @@ created: 20140410103123179 -modified: 20150118182915000 +modified: 20150119192731000 tags: [[Filter Operators]] [[String Operators]] title: addprefix Operator type: text/vnd.tiddlywiki caption: addprefix -purpose: extend each input item with a prefix +purpose: extend each input title with a prefix -<<.operator-def -input:"a [[set|Tiddler Sets]] of strings" -parameter:"a prefix to be added" -paramName:"p" -output:"a copy of the input, but with the prefix added to the start of each string" ->> +<$macrocall $name=".operator-def" +input="a [[title selection|Title Selections]]" +parameter="a prefix to be added" +paramName="p" +output="a copy of the input, but with <<.place p>> added to the start of each title" +/> <<.operator-examples "addprefix">> diff --git a/editions/tw5.com/tiddlers/filters/addsuffix.tid b/editions/tw5.com/tiddlers/filters/addsuffix.tid index 24a11c26b..a50f01051 100644 --- a/editions/tw5.com/tiddlers/filters/addsuffix.tid +++ b/editions/tw5.com/tiddlers/filters/addsuffix.tid @@ -1,16 +1,16 @@ created: 20140828133830424 -modified: 20150118182957000 +modified: 20150119192734000 tags: [[Filter Operators]] [[String Operators]] title: addsuffix Operator type: text/vnd.tiddlywiki caption: addsuffix -purpose: extend each input item with a suffix +purpose: extend each input title with a suffix -<<.operator-def -input:"a [[set|Tiddler Sets]] of strings" -parameter:"a suffix to be added" -paramName:"p" -output:"a copy of the input, but with the suffix added to the end of each string" ->> +<$macrocall $name=".operator-def" +input="a [[title selection|Title Selections]]" +parameter="a suffix to be added" +paramName="p" +output="a copy of the input, but with <<.place p>> added to the end of each title" +/> <<.operator-examples "addsuffix">> diff --git a/editions/tw5.com/tiddlers/filters/after.tid b/editions/tw5.com/tiddlers/filters/after.tid index 0ac8a6a42..1dba30173 100644 --- a/editions/tw5.com/tiddlers/filters/after.tid +++ b/editions/tw5.com/tiddlers/filters/after.tid @@ -1,18 +1,18 @@ created: 20140512103123179 -modified: 20150118183000000 +modified: 20150119192331000 tags: [[Filter Operators]] [[List Operators]] title: after Operator type: text/vnd.tiddlywiki caption: after -purpose: get the successor of an input item +purpose: get the title that follows a particular one in the input <$macrocall $name=".operator-def" -input="a [[set|Tiddler Sets]] of strings" -parameter="one of those strings" +input="a [[title selection|Title Selections]]" +parameter="one of those titles" paramName="p" -output="the string that immediately follows <<.place p>> in the input set" +output="the title that immediately follows <<.place p>> in the input" /> -If <<.place p>> is not present in the input set, or is the last item, then the output is empty. +If <<.place p>> is not present in the input, or is the last item there, then the output is empty. <<.operator-examples "after">> diff --git a/editions/tw5.com/tiddlers/filters/all.tid b/editions/tw5.com/tiddlers/filters/all.tid index 327e179eb..ed08432f8 100644 --- a/editions/tw5.com/tiddlers/filters/all.tid +++ b/editions/tw5.com/tiddlers/filters/all.tid @@ -1,6 +1,6 @@ created: 20140410103123179 -modified: 20150118183004000 -tags: [[Filter Operators]] [[Common Operators]] [[Absolute Operators]] [[Link Operators]] +modified: 20150119191633000 +tags: [[Filter Operators]] [[Common Operators]] [[Absolute Operators]] [[Category Operators]] title: all Operator type: text/vnd.tiddlywiki caption: all @@ -10,24 +10,26 @@ purpose: get all tiddlers of a basic category input="ignored, unless <<.place p>> is empty" parameter="see below" paramName="p" -output="the [[set|Tiddler Sets]] of tiddler titles that belong to one or more basic categories" +output="the complete [[selection|Title Selections]] of tiddler titles that belong to one or more basic categories" /> -The parameter specifies categories using the following syntax: +The parameter specifies tiddler categories using the following syntax: <$railroad text=""" [{: ("current" | "missing" |: "orphans" | "shadows" | "tiddlers" ) +"+" }] """/> |!Category |!Members |!Sorted | -|^`current`|just the [[current tiddler|CurrentTiddler]]|^--| -|^`missing`|all non-existent tiddlers to which there is at least one [[observable link|Observable Links]]|^no| -|^`orphans`|all tiddlers to which there are <<.em no>> observable links|^by title| -|^`shadows`|all the [[shadow tiddlers|ShadowTiddlers]] that exist, including any that have been overridden with non-shadow tiddlers|^no| -|^`tiddlers`|all the non-shadow tiddlers that exist|no| +|^`current` |just the [[current tiddler|CurrentTiddler]] |^-- | +|^`missing` |all non-existent tiddlers to which there is at least one [[observable link|Observable Links]] |^no | +|^`orphans` |all tiddlers to which there are <<.em no>> observable links |^by title | +|^`shadows` |all the [[shadow tiddlers|ShadowTiddlers]] that exist, including any that have been overridden with non-shadow tiddlers |^no | +|^`tiddlers` |all the non-shadow tiddlers that exist |no | -If the parameter specifies more than one category, they are processed from left to right. The overall output is initially empty, and each parameter's output is [[dominantly appended|Dominant Append]] to it in turn. +If the parameter specifies more than one category, they are processed from left to right. The overall output is initially empty, and each category's output is [[dominantly appended|Dominant Append]] to it in turn. Unrecognised categories contribute nothing to the output. As a special case, if there is no parameter, the output is simply a copy of the input. This can be useful when the parameter is [[supplied indirectly|Filter Parameters]]. +The <<.op is>> operator is similar, but its scope is restricted to its input tiddlers. + <<.operator-examples "all">> diff --git a/editions/tw5.com/tiddlers/filters/backlinks.tid b/editions/tw5.com/tiddlers/filters/backlinks.tid index 7e47e73ef..5a5161ebf 100644 --- a/editions/tw5.com/tiddlers/filters/backlinks.tid +++ b/editions/tw5.com/tiddlers/filters/backlinks.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20150118183008000 +modified: 20150119192416000 tags: [[Filter Operators]] [[Link Operators]] title: backlinks Operator type: text/vnd.tiddlywiki @@ -7,11 +7,11 @@ caption: backlinks purpose: get the tiddlers that link to each input tiddler <$macrocall $name=".operator-def" -input="a [[set|Tiddler Sets]] of tiddler titles" +input="a [[title selection|Title Selections]]" parameter="none" output="the titles of any non-system tiddlers that contain [[Observable Links]] to the input tiddlers" /> -Each input tiddler is processed in turn. Its corresponding set of backlinks is generated, sorted by title, and then [[dominantly appended|Dominant Append]] to the operator's overall output. +Each input tiddler is processed in turn. Its corresponding list of backlinks is generated, sorted by title, and then [[dominantly appended|Dominant Append]] to the operator's overall output. <<.operator-examples "backlinks">> diff --git a/editions/tw5.com/tiddlers/filters/before.tid b/editions/tw5.com/tiddlers/filters/before.tid index 5c8016779..2c4b38791 100644 --- a/editions/tw5.com/tiddlers/filters/before.tid +++ b/editions/tw5.com/tiddlers/filters/before.tid @@ -1,18 +1,18 @@ created: 20140512103123179 -modified: 20150118183011000 +modified: 20150119192411000 tags: [[Filter Operators]] [[List Operators]] caption: before title: before Operator type: text/vnd.tiddlywiki -purpose: get the predecessor of an input item +purpose: get the title that precedes a particular one in the input <$macrocall $name=".operator-def" -input="a [[set|Tiddler Sets]] of strings" -parameter="one of those strings" +input="a [[title selection|Title Selections]]" +parameter="one of those titles" paramName="p" -output="the string that immediately precedes <<.place p>> in the input set" +output="the title that immediately precedes <<.place p>> in the input" /> -If <<.place p>> is not present in the input set, or is the first item, then the output is empty. +If <<.place p>> is not present in the input, or is the first title there, then the output is empty. <<.operator-examples "before">> diff --git a/editions/tw5.com/tiddlers/filters/butlast.tid b/editions/tw5.com/tiddlers/filters/butlast.tid index e4b297642..e9fdbf0a1 100644 --- a/editions/tw5.com/tiddlers/filters/butlast.tid +++ b/editions/tw5.com/tiddlers/filters/butlast.tid @@ -1,16 +1,16 @@ created: 20140410103123179 -modified: 20150118183022000 +modified: 20150119192424000 tags: [[Filter Operators]] [[Sequence Operators]] title: butlast Operator type: text/vnd.tiddlywiki caption: butlast -purpose: get all the but last <<.place n>> input items +purpose: get all the but last <<.place n>> input titles <$macrocall $name=".operator-def" -input="a [[set|Tiddler Sets]] of strings" +input="a [[title selection|Title Selections]]" parameter="an integer, defaulting to 1" paramName="n" -output="all but the last <<.place n>> strings from the input set" +output="all but the last <<.place n>> titles from the input" /> <<.operator-examples "butlast">> diff --git a/editions/tw5.com/tiddlers/filters/commands.tid b/editions/tw5.com/tiddlers/filters/commands.tid index ae55ecbbe..4152f8266 100644 --- a/editions/tw5.com/tiddlers/filters/commands.tid +++ b/editions/tw5.com/tiddlers/filters/commands.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20150118183026000 +modified: 20150119191708000 tags: [[Filter Operators]] [[Non-Tiddler Operators]] [[Absolute Operators]] title: commands Operator type: text/vnd.tiddlywiki @@ -9,7 +9,7 @@ purpose: get all the Node.js commands <$macrocall $name=".operator-def" input="ignored" parameter="none" -output="the set of [[commands|Commands]] that can be given to [[TiddlyWiki on Node.js]]" +output="the [[selection|Title Selections]] of [[commands|Commands]] that can be given to [[TiddlyWiki on Node.js]]" /> <<.operator-examples "commands">> diff --git a/editions/tw5.com/tiddlers/filters/each.tid b/editions/tw5.com/tiddlers/filters/each.tid index 2dc69b024..b6c15b1d5 100644 --- a/editions/tw5.com/tiddlers/filters/each.tid +++ b/editions/tw5.com/tiddlers/filters/each.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20150118183030000 +modified: 20150119192427000 tags: [[Filter Operators]] [[Group Operators]] title: each Operator type: text/vnd.tiddlywiki @@ -7,10 +7,10 @@ caption: each purpose: get one of each group of input tiddlers by field value <$macrocall $name=".operator-def" -input="a [[set|Tiddler Sets]] of tiddler titles" +input="a [[title selection|Title Selections]]" parameter="the name of a [[field|TiddlerFields]]" paramName="f" -output="a set containing the first tiddler with each distinct value for field <<.place f>>" +output="a [[selection|Title Selections]] containing the first tiddler found with each distinct value for field <<.place f>>" /> Each input tiddler is processed in turn. The value of field <<.place f>> in that tiddler is examined, and as long as the value has not been encountered before, the tiddler's title is appended to the output set. diff --git a/editions/tw5.com/tiddlers/filters/eachday.tid b/editions/tw5.com/tiddlers/filters/eachday.tid index 4800f8b07..86fb3659d 100644 --- a/editions/tw5.com/tiddlers/filters/eachday.tid +++ b/editions/tw5.com/tiddlers/filters/eachday.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20150118183035000 +modified: 20150119192430000 tags: [[Filter Operators]] [[Group Operators]] title: eachday Operator type: text/vnd.tiddlywiki @@ -7,12 +7,12 @@ caption: eachday purpose: get one of each group of input tiddlers by date <$macrocall $name=".operator-def" -input="a [[set|Tiddler Sets]] of tiddler titles" +input="a [[selection|Title Selections]] of tiddler titles" parameter="the name of a [[date field|DateFields]]" paramName="f" -output="a set containing the first tiddler with each distinct value (ignoring time of day) for field <<.place f>>" +output="a [[selection|Title Selections]] containing the first tiddler found with each distinct value (ignoring times of day) for field <<.place f>>" /> -Each input tiddler is processed in turn. The value of field <<.place f>> in that tiddler is examined, and as long as this indicates a day that has not been encountered before, the tiddler's title is appended to the output set. +Each input tiddler is processed in turn. The value of field <<.place f>> in that tiddler is examined, and as long as this indicates a date that has not been encountered before, the tiddler's title is appended to the output set. <<.operator-examples "eachday">> diff --git a/editions/tw5.com/tiddlers/filters/editiondescription.tid b/editions/tw5.com/tiddlers/filters/editiondescription.tid index 55c0c6d05..68c5b1401 100644 --- a/editions/tw5.com/tiddlers/filters/editiondescription.tid +++ b/editions/tw5.com/tiddlers/filters/editiondescription.tid @@ -1,5 +1,5 @@ created: 20150111145738451 -modified: 20150118183039000 +modified: 20150119192433000 tags: [[Filter Operators]] [[Non-Tiddler Operators]] [[Node.js Operators]] title: editiondescription Operator type: text/vnd.tiddlywiki @@ -7,9 +7,11 @@ caption: editiondescription purpose: get the descriptions of the input ~TiddlyWiki editions <$macrocall $name=".operator-def" -input="a [[set|Tiddler Sets]] of ~TiddlyWiki edition names" +input="a [[selection|Title Selections]] of edition names" parameter="none" output="the description string of each edition in the input" /> +Each input title is processed in turn, ignoring any that is not the name of a ~TiddlyWiki edition. + <<.node-only-operator>> diff --git a/editions/tw5.com/tiddlers/filters/examples/indexes.tid b/editions/tw5.com/tiddlers/filters/examples/indexes.tid new file mode 100644 index 000000000..b60e14f5c --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/indexes.tid @@ -0,0 +1,8 @@ +created: 20150119125815000 +modified: 20150119191028000 +tags: [[indexes Operator]] [[Operator Examples]] +title: indexes Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[{$:/palette}indexes[]sort[title]]" "all the colours defined in the current [[colour palette|ColourPalettes]]">> +<<.operator-example 2 "[[$:/HistoryList]indexes[]]" "integer output because the [[history list|$:/HistoryList]] is an array">> diff --git a/editions/tw5.com/tiddlers/filters/examples/is.tid b/editions/tw5.com/tiddlers/filters/examples/is.tid new file mode 100644 index 000000000..d81a9bf77 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/is.tid @@ -0,0 +1,13 @@ +created: 20150119133413000 +modified: 20150119134652000 +tags: [[is Operator]] [[Operator Examples]] +title: is Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[is[tag]]">> +<<.operator-example 2 "[!is[tag]]">> +<<.operator-example 3 "[all[shadows]!is[system]]" "shadow tiddlers that don't start with `$:/`">> +<<.operator-example 4 "[is[system]tag[$:/tags/Stylesheet]]" "system stylesheets">> +<<.operator-example 5 "[all[shadows]is[system]tag[$:/tags/Stylesheet]]" "shadow system stylesheets">> +<<.operator-example 6 "[is[shadow]]" "overridden shadow tiddlers">> +<<.operator-example 7 "[is[missing]]" "empty because its input contains only tiddlers that exist">> diff --git a/editions/tw5.com/tiddlers/filters/examples/last.tid b/editions/tw5.com/tiddlers/filters/examples/last.tid new file mode 100644 index 000000000..2aec8e58d --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/last.tid @@ -0,0 +1,11 @@ +created: 20150118134611000 +modified: 20150119182151000 +tags: [[last Operator]] [[Operator Examples]] +title: last Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]last[]]">> +<<.operator-example 2 "[list[Days of the Week]last[5]]">> +<<.operator-example 3 "[tag[Concepts]!sort[title]last[3]]">> diff --git a/editions/tw5.com/tiddlers/filters/field.tid b/editions/tw5.com/tiddlers/filters/field.tid index 8ac452321..215048838 100644 --- a/editions/tw5.com/tiddlers/filters/field.tid +++ b/editions/tw5.com/tiddlers/filters/field.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20150118183046000 +modified: 20150119192437000 tags: [[Filter Operators]] [[Common Operators]] [[Field Operators]] title: field Operator type: text/vnd.tiddlywiki @@ -7,12 +7,12 @@ caption: field purpose: filter the input tiddlers by field value <$macrocall $name=".operator-def-suffix" -input="a [[set|Tiddler Sets]] of tiddler titles" +input="a [[title selection|Title Selections]]" suffix="the name of a field" suffixName="f" parameter="a potential value for field <<.place f>>" paramName="p" -output="the subset of the input tiddlers in which field <<.place f>> has the value <<.place p>>" +output="the [[subselection|Title Selections]] of the input tiddlers in which field <<.place f>> has the value <<.place p>>" /> If <<.place p>> is empty, <<.op field>> will match both of the following: @@ -21,7 +21,7 @@ If <<.place p>> is empty, <<.op field>> will match both of the following: * tiddlers in which field <<.place f>> exists but has an empty value ;Negation -: `!field` outputs the subset of the input tiddlers in which field <<.place f>> does <<.em not>> have the value <<.place p>>. +: `!field` outputs the subselection of the input tiddlers in which field <<.place f>> does <<.em not>> have the value <<.place p>>. The [[Filter Syntax]] treats any unrecognised [[filter operator|Filter Operators]] as if it was the suffix to the <<.olink field>> operator. See the second example below. diff --git a/editions/tw5.com/tiddlers/filters/fields.tid b/editions/tw5.com/tiddlers/filters/fields.tid index 59854b39f..9f037fd86 100644 --- a/editions/tw5.com/tiddlers/filters/fields.tid +++ b/editions/tw5.com/tiddlers/filters/fields.tid @@ -1,5 +1,5 @@ created: 20140924115616653 -modified: 20150118183051000 +modified: 20150119192440000 tags: [[Filter Operators]] [[Field Operators]] title: fields Operator type: text/vnd.tiddlywiki @@ -7,11 +7,11 @@ caption: fields purpose: get all fields of the input tiddlers <$macrocall $name=".operator-def" -input="a [[set|Tiddler Sets]] of tiddler titles" +input="a [[selection|Title Selections]] of tiddler titles" parameter="none" -output="the [[set|Tiddler Sets]] of all field names contained in the input tiddlers" +output="the [[selection|Title Selections]] of all field names contained in the input tiddlers" /> -Each input item is processed in turn. Its set of field names is retrieved (in no particular order) and then [[dominantly appended|Dominant Append]] to the operator's output. +Each input title is processed in turn. Its list of field names is retrieved (in no particular order) and then [[dominantly appended|Dominant Append]] to the operator's output. <<.operator-examples "fields">> diff --git a/editions/tw5.com/tiddlers/filters/first.tid b/editions/tw5.com/tiddlers/filters/first.tid index 01f18a989..45011e60e 100644 --- a/editions/tw5.com/tiddlers/filters/first.tid +++ b/editions/tw5.com/tiddlers/filters/first.tid @@ -1,16 +1,16 @@ created: 20140410103123179 -modified: 20150118183055000 +modified: 20150119192443000 tags: [[Filter Operators]] [[List Operators]] title: first Operator type: text/vnd.tiddlywiki caption: first -purpose: get the first <<.place n>> input items +purpose: get the first <<.place n>> input titles <$macrocall $name=".operator-def" -input="a [[set|Tiddler Sets]] of strings" +input="a [[selection|Title Selections]] of titles" parameter="an integer, defaulting to 1" paramName="n" -output="the first <<.place n>> items from the input set" +output="the first <<.place n>> titles from the input" /> <<.operator-examples "first">> diff --git a/editions/tw5.com/tiddlers/filters/get.tid b/editions/tw5.com/tiddlers/filters/get.tid index e7001bd62..d89ad6d37 100644 --- a/editions/tw5.com/tiddlers/filters/get.tid +++ b/editions/tw5.com/tiddlers/filters/get.tid @@ -1,5 +1,5 @@ created: 20140426183123179 -modified: 20150118183058000 +modified: 20150119192446000 tags: [[Filter Operators]] [[Field Operators]] title: get Operator type: text/vnd.tiddlywiki @@ -7,7 +7,7 @@ caption: get purpose: get the values of a field from all input tiddlers <$macrocall $name=".operator-def" -input="a [[set|Tiddler Sets]] of tiddler titles" +input="a [[selection|Title Selections]] of tiddler titles" parameter="the name of a [[field|TiddlerFields]]" paramName="f" output="the values of field <<.place f>> in each of the input tiddlers" diff --git a/editions/tw5.com/tiddlers/filters/has.tid b/editions/tw5.com/tiddlers/filters/has.tid index 2c766cfa7..ed13e935e 100644 --- a/editions/tw5.com/tiddlers/filters/has.tid +++ b/editions/tw5.com/tiddlers/filters/has.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20150118183102000 +modified: 20150119192449000 tags: [[Filter Operators]] [[Common Operators]] [[Field Operators]] title: has Operator type: text/vnd.tiddlywiki @@ -8,10 +8,10 @@ purpose: filter the input tiddlers by field existence <$macrocall $name=".operator-def" syntax="has[f]" -input="a [[set|Tiddler Sets]] of tiddler titles" +input="a [[selection|Title Selections]] of tiddler titles" parameter="the name of a field" paramName="f" -output="the subset of the input tiddlers that have a value in field <<.place f>>" +output="the [[subselection|Title Selections]] of the input tiddlers that have a value in field <<.place f>>" /> <<.op has>> filters out both of the following: diff --git a/editions/tw5.com/tiddlers/filters/indexes.tid b/editions/tw5.com/tiddlers/filters/indexes.tid index 5a54ef334..105974d41 100644 --- a/editions/tw5.com/tiddlers/filters/indexes.tid +++ b/editions/tw5.com/tiddlers/filters/indexes.tid @@ -1,14 +1,19 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -title: FilterOperator: indexes -caption: indexes +modified: 20150119192453000 +tags: [[Filter Operators]] +title: indexes Operator type: text/vnd.tiddlywiki +caption: indexes +purpose: get all properties of the input data tiddlers -The ''indexes'' filter operator returns a list of all the property indexes found in the DataTiddlers in the current list. Tiddlers that are not DataTiddlers are ignored. +<$macrocall $name=".operator-def" +input="a [[selection|Title Selections]] of tiddler titles" +parameter="none" +output="the [[selection|Title Selections]] of all property names contained in the input data tiddlers" +/> -For example: +Each input title is processed in turn, and is ignored if it does not denote a [[data tiddler|DataTiddlers]]. The list of property names is retrieved from the data tiddler (in no particular order) and then [[dominantly appended|Dominant Append]] to the operator's output. -|!Filter String |!Description | -|`[[MyData]indexes[]]` |Returns the indexes of all properties in the data tiddler `MyData` | -|`[{$:/palette}indexes[]sort[title]]` |Returns the names of all the colours defined in the current [[colour palette|ColourPalettes]] | +Where a tiddler's [[content is JSON|JSONTiddlers]] with an array as its root, the <<.op indexes>> operator retrieves a selection of integer indexes instead. + +<<.operator-examples "indexes">> diff --git a/editions/tw5.com/tiddlers/filters/is.tid b/editions/tw5.com/tiddlers/filters/is.tid index 2e9a21e15..5269acf04 100644 --- a/editions/tw5.com/tiddlers/filters/is.tid +++ b/editions/tw5.com/tiddlers/filters/is.tid @@ -1,29 +1,37 @@ created: 20140410103123179 -modified: 20150118182931000 -tags: Filters CommonFilters -caption: is +modified: 20150119192457000 +tags: [[Filter Operators]] [[Common Operators]] [[Category Operators]] title: is Operator type: text/vnd.tiddlywiki +caption: is +purpose: filter the input tiddlers by basic category -The ''is'' filter operator selects tiddlers from the current list according to their membership of the category specified in the operand: +<$macrocall $name=".operator-def" +input="a [[selection|Title Selections]] of titles" +parameter="see below" +paramName="p" +output="the [[subselection|Title Selections]] of the input tiddlers that belong to the specified basic category" +/> -* `[is[current]]` - returns any tiddler that matches the title of the current tiddler -* `[is[image]]` - tiddlers that contain an image (eg, GIF, JPEG, PNG etc.) -* `[is[missing]]` - MissingTiddlers that are referenced but undefined -* `[is[orphan]]` - OrphanTiddlers that are not referenced from any other tiddler -* `[is[shadow]]` - tiddlers that are ShadowTiddlers -* `[is[system]]` - tiddlers that are SystemTiddlers -* `[is[tiddler]]` - tiddlers that are not MissingTiddlers -* `[is[tag]]` - tiddlers that are being used as tags +The parameter is one of the following categories: -For example: +|!Category |!Matches any tiddler that... | +|^`current`|is the [[current tiddler|CurrentTiddler]] | +|^`image`|has an image ContentType | +|^`missing` |does not exist (other than possibly as a non-shadow tiddler), regardless of whether there are any links it | +|^`orphan` |has no [[Observable Links]] to it | +|^`shadow` |is a [[shadow tiddler|ShadowTiddlers]], regardless of whether it has been overridden with a non-shadow tiddler | +|^`system` |is a [[system tiddler|SystemTiddlers]], i.e. its title starts with `$:/` | +|^`tag` |is in use as a tag | +|^`tiddler` |exists as a non-shadow tiddler | -|!Filter String |!Description | -|`[tag[task]is[shadow]]` |Returns ShadowTiddlers tagged `task` | -|`[tag[task]!is[system]]` |Returns non-SystemTiddlers tagged `task` | -|`[is[shadow]]` |Returns ShadowTiddlers that have been overridden by a 'real' tiddler | -|`[!is[shadow]]` |Returns ordinary tiddlers that are not shadow tiddlers | -|`[!is[tag]]` |Returns all tiddlers that are not being used as tags | -|`[is[missing]]` |Returns an empty list (see note below) | +;Negation +: `!is` outputs the subselection of the input tiddlers that are <<.em not>> in the specified category. `!is[tiddler]` is a synonym for `is[missing]`, and vice versa. -Note that the ''is'' filter operator strictly filters the current list by choosing whether or not to include each one in the output. It never adds tiddlers to the results that are not already listed. This means that when used at the start of a run of filter operators the ''is'' operator will be choosing from the currently existing tiddlers, and so will never return missing tiddlers, or shadow tiddlers that haven't been overridden. +An unrecognised category outputs an error string. + +When <<.op is[missing]>> is the first operator in a [[run|Filter Syntax]], its output is always empty. And when <<.op is[shadow]>> comes first, it outputs only those shadow tiddlers that have been overridden. This is because the [[initial input to a run|Filter Syntax]] contains only <<.em non>>-shadow tiddlers. + +The <<.op all>> operator is similar, but its scope is the whole wiki. + +<<.operator-examples "is">> diff --git a/editions/tw5.com/tiddlers/filters/last.tid b/editions/tw5.com/tiddlers/filters/last.tid index 20459fd68..0a993eb9d 100644 --- a/editions/tw5.com/tiddlers/filters/last.tid +++ b/editions/tw5.com/tiddlers/filters/last.tid @@ -1,14 +1,16 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: last -title: FilterOperator: last +modified: 20150119192502000 +tags: [[Filter Operators]] [[List Operators]] +title: last Operator type: text/vnd.tiddlywiki +caption: last +purpose: get the last <<.place n>> input titles -The ''last'' filter operator returns the last entries in the current list. The optional operand specifies the number of entries to return. +<$macrocall $name=".operator-def" +input="a [[selection|Title Selections]] of titles" +parameter="an integer, defaulting to 1" +paramName="n" +output="the last <<.place n>> titles from the input" +/> -For example: - -|!Filter String |!Description | -|`one two three +[last[]]` |Returns `three` | -|`one two three +[last[2]]` |Returns `two`, `three` | +<<.operator-examples "last">> diff --git a/editions/tw5.com/tiddlers/howtos/Tagging.tid b/editions/tw5.com/tiddlers/howtos/Tagging.tid index 12a6edb27..158ad7fe7 100644 --- a/editions/tw5.com/tiddlers/howtos/Tagging.tid +++ b/editions/tw5.com/tiddlers/howtos/Tagging.tid @@ -1,5 +1,5 @@ created: 20140904075400000 -modified: 20150118182337000 +modified: 20150119191356000 tags: [[Working with TiddlyWiki]] Concepts title: Tagging type: text/vnd.tiddlywiki @@ -35,7 +35,7 @@ You can use the [[tag manager|$:/TagManager]], found on the ''Tags'' tab under ' By default, tagged tiddlers are listed in the order they were added to the wiki. The <<.olink sort>> operator can change the order to alphabetical. -If you want any other order, add a [[field called ''list''|ListField]] to the tag tiddler, and set its value to be a [[TitleList]] of the tiddlers in that order. +If you want any other order, add a [[field called ''list''|ListField]] to the tag tiddler, and set its value to be a [[list of the tiddlers|Title Lists]] in that order. The ''list'' field doesn't have to mention all of the tiddlers. Here are the precise rules ~TiddlyWiki uses to order tagged tiddlers: diff --git a/editions/tw5.com/tiddlers/system/operator-macros.tid b/editions/tw5.com/tiddlers/system/operator-macros.tid index 30e281cd5..55ab81cb4 100644 --- a/editions/tw5.com/tiddlers/system/operator-macros.tid +++ b/editions/tw5.com/tiddlers/system/operator-macros.tid @@ -1,5 +1,5 @@ created: 20150117152607000 -modified: 20150118181923000 +modified: 20150119193041000 title: $:/editions/tw5.com/operator-macros tags: $:/tags/Macro @@ -8,7 +8,7 @@ tags: $:/tags/Macro input $input$ -parameter <<.place "$paramName$">> +parameter<$macrocall $name=".if" cond="$paramName$" then=" <<.place '$paramName$'>>"/> $parameter$ output @@ -21,10 +21,10 @@ tags: $:/tags/Macro input $input$ -suffix <<.place "$suffixName$">> +suffix <<.place "$suffixName$">> $suffix$ -parameter <<.place "$paramName$">> +parameter<$macrocall $name=".if" cond="$paramName$" then=" <<.place '$paramName$'>>"/> $parameter$ output @@ -37,7 +37,7 @@ tags: $:/tags/Macro \define .operator-example(n,eg,ie)
`$eg$` -<<.if cond:"$ie$" then:"
i.e. $ie$
">> +<<.if cond:"$ie$" then:"
$ie$
">> <$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix[$n$]]" variable=".state"> <$reveal state=<<.state>> type="nomatch" text="show">
diff --git a/editions/tw5.com/tiddlers/workingwithtw/Creating journal tiddlers.tid b/editions/tw5.com/tiddlers/workingwithtw/Creating journal tiddlers.tid index 47f87b23d..495b3c5fd 100644 --- a/editions/tw5.com/tiddlers/workingwithtw/Creating journal tiddlers.tid +++ b/editions/tw5.com/tiddlers/workingwithtw/Creating journal tiddlers.tid @@ -1,5 +1,5 @@ created: 20141010093214683 -modified: 20141125123700243 +modified: 20150119191403000 tags: [[Working with TiddlyWiki]] title: Creating journal tiddlers type: text/vnd.tiddlywiki @@ -29,7 +29,7 @@ For example, you might be reviewing a tiddler called ''Oxford Street'' and reali To configure how new journal entries are created, visit the ''Basics'' tab under ''Info'' in the [[control panel|$:/ControlPanel]]: * "Title of new journal tiddlers" specifies how these tiddlers should be named, as a [[date format string|DateFormat]]. The default setting of `DDth MMM YYYY` causes new entries to have titles of the form "10th October 2014" -* "Tags for new journal tiddlers" [specifies|TitleList] tags that will automatically appear on new journal entries. For example: `Journal [[Summer vacation]]` +* "Tags for new journal tiddlers" [specifies|Title Lists] tags that will automatically appear on new journal entries. For example: `Journal [[Summer vacation]]` Hint: if you want to create a separate journal tiddler whenever you click ''new journal'' (even if you do this several times in the same day), you can include the clock time in the title format. Specify something like `YYYY-0MM-0DD at 0hhh0mm'0ss''` as the date format. From aac2a63e054aacc2d56edd79350fcf9ab446ab15 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Sat, 24 Jan 2015 21:18:44 +0000 Subject: [PATCH 06/10] Overhaul the filter operator documentation: part 2 --- .../tiddlers/concepts/AbsoluteOperators.tid | 8 +- .../tiddlers/concepts/DominantAppend.tid | 10 +-- .../tiddlers/concepts/FilterParameters.tid | 20 ----- .../tw5.com/tiddlers/concepts/Filters.tid | 6 +- .../tiddlers/concepts/HardAndSoftLinks.tid | 15 ++++ .../tiddlers/concepts/ObservableLinks.tid | 20 ----- .../concepts/OrderOfTaggedTiddlers.tid | 15 ++++ .../tiddlers/concepts/RailroadDiagrams.tid | 8 +- .../tiddlers/concepts/TextReference.tid | 4 +- .../tw5.com/tiddlers/concepts/TitleList.tid | 8 +- ...TitleSelections.tid => TitleSelection.tid} | 6 +- .../demonstrations/Tasks/Kill the Dragon.tid | 3 +- .../tiddlers/demonstrations/Tasks/task.tid | 5 +- .../Weekdays}/Days of the Week.tid | 4 +- .../Weekdays}/Friday.tid | 0 .../Weekdays}/Monday.tid | 0 .../Weekdays}/Saturday.tid | 0 .../Weekdays}/Sunday.tid | 0 .../Weekdays}/Thursday.tid | 6 +- .../Weekdays}/Tuesday.tid | 0 .../Weekdays}/Wednesday.tid | 0 .../tw5.com/tiddlers/fields/ListField.tid | 4 +- .../tiddlers/filters/FilterOperators.tid | 40 ++++++--- .../tw5.com/tiddlers/filters/FilterSyntax.tid | 87 ------------------- .../filters/Introduction to Filters.tid | 6 +- .../tw5.com/tiddlers/filters/addprefix.tid | 10 +-- .../tw5.com/tiddlers/filters/addsuffix.tid | 10 +-- editions/tw5.com/tiddlers/filters/after.tid | 14 +-- editions/tw5.com/tiddlers/filters/all.tid | 23 +++-- .../tw5.com/tiddlers/filters/backlinks.tid | 12 +-- editions/tw5.com/tiddlers/filters/before.tid | 14 +-- editions/tw5.com/tiddlers/filters/bf.tid | 4 +- .../tw5.com/tiddlers/filters/butfirst.tid | 4 +- editions/tw5.com/tiddlers/filters/butlast.tid | 10 +-- .../tw5.com/tiddlers/filters/commands.tid | 9 +- editions/tw5.com/tiddlers/filters/each.tid | 12 +-- editions/tw5.com/tiddlers/filters/eachday.tid | 16 ++-- .../tiddlers/filters/editiondescription.tid | 8 +- .../tw5.com/tiddlers/filters/editions.tid | 8 +- .../tw5.com/tiddlers/filters/examples/get.tid | 3 +- .../tiddlers/filters/examples/limit.tid | 8 ++ .../tiddlers/filters/examples/links.tid | 14 +++ .../tiddlers/filters/examples/list.tid | 10 +++ .../tiddlers/filters/examples/listed.tid | 8 ++ .../tiddlers/filters/examples/modules.tid | 7 ++ .../tiddlers/filters/examples/moduletypes.tid | 7 ++ .../tiddlers/filters/examples/next.tid | 11 +++ .../tiddlers/filters/examples/nsort.tid | 8 ++ .../tiddlers/filters/examples/nsortcs.tid | 8 ++ .../tw5.com/tiddlers/filters/examples/nth.tid | 10 +++ .../filters/examples/plugintiddlers.tid | 8 ++ .../tiddlers/filters/examples/prefix.tid | 9 ++ .../tiddlers/filters/examples/previous.tid | 11 +++ .../tiddlers/filters/examples/regexp.tid | 21 +++++ .../filters/examples/removeprefix.tid | 7 ++ .../filters/examples/removesuffix.tid | 9 ++ .../tiddlers/filters/examples/rest.tid | 11 +++ .../tiddlers/filters/examples/reverse.tid | 9 ++ .../tiddlers/filters/examples/sameday.tid | 8 ++ .../tiddlers/filters/examples/search.tid | 10 +++ .../filters/examples/shadowsource.tid | 8 ++ .../tiddlers/filters/examples/sort.tid | 13 +++ .../tiddlers/filters/examples/sortcs.tid | 10 +++ .../tiddlers/filters/examples/suffix.tid | 8 ++ .../tiddlers/filters/examples/tag - Copy.tid | 9 ++ .../tw5.com/tiddlers/filters/examples/tag.tid | 10 +++ .../tiddlers/filters/examples/tagging.tid | 9 ++ .../tiddlers/filters/examples/tags.tid | 9 ++ .../tiddlers/filters/examples/title.tid | 15 ++++ editions/tw5.com/tiddlers/filters/field.tid | 26 +++--- editions/tw5.com/tiddlers/filters/fields.tid | 8 +- editions/tw5.com/tiddlers/filters/first.tid | 10 +-- editions/tw5.com/tiddlers/filters/get.tid | 12 +-- editions/tw5.com/tiddlers/filters/has.tid | 21 ++--- editions/tw5.com/tiddlers/filters/indexes.tid | 10 +-- editions/tw5.com/tiddlers/filters/is.tid | 32 +++---- editions/tw5.com/tiddlers/filters/last.tid | 10 +-- editions/tw5.com/tiddlers/filters/limit.tid | 24 ++--- editions/tw5.com/tiddlers/filters/links.tid | 21 +++-- editions/tw5.com/tiddlers/filters/list.tid | 27 +++--- editions/tw5.com/tiddlers/filters/listed.tid | 24 +++-- editions/tw5.com/tiddlers/filters/modules.tid | 22 ++--- .../tw5.com/tiddlers/filters/moduletypes.tid | 22 ++--- editions/tw5.com/tiddlers/filters/next.tid | 29 +++---- editions/tw5.com/tiddlers/filters/nsort.tid | 25 +++--- editions/tw5.com/tiddlers/filters/nsortcs.tid | 25 +++--- editions/tw5.com/tiddlers/filters/nth.tid | 24 ++--- .../tiddlers/filters/plugintiddlers.tid | 22 ++--- editions/tw5.com/tiddlers/filters/prefix.tid | 25 +++--- .../tw5.com/tiddlers/filters/previous.tid | 29 +++---- editions/tw5.com/tiddlers/filters/regexp.tid | 48 +++++----- .../tw5.com/tiddlers/filters/removeprefix.tid | 23 ++--- .../tw5.com/tiddlers/filters/removesuffix.tid | 23 ++--- editions/tw5.com/tiddlers/filters/rest.tid | 22 +++-- editions/tw5.com/tiddlers/filters/reverse.tid | 20 +++-- editions/tw5.com/tiddlers/filters/sameday.tid | 26 +++--- editions/tw5.com/tiddlers/filters/search.tid | 29 ++++--- .../tw5.com/tiddlers/filters/shadowsource.tid | 22 ++--- editions/tw5.com/tiddlers/filters/sort.tid | 27 +++--- editions/tw5.com/tiddlers/filters/sortcs.tid | 24 ++--- editions/tw5.com/tiddlers/filters/suffix.tid | 25 +++--- .../filters/syntax/FilterExpression.tid | 28 ++++++ .../filters/syntax/FilterParameter.tid | 27 ++++++ .../tiddlers/filters/syntax/FilterRun.tid | 26 ++++++ .../tiddlers/filters/syntax/FilterStep.tid | 21 +++++ .../tiddlers/filters/syntax/FilterSyntax.tid | 18 ++++ .../filters/syntax/FilterWhitespace.tid | 11 +++ editions/tw5.com/tiddlers/filters/tag.tid | 28 +++--- editions/tw5.com/tiddlers/filters/tagging.tid | 23 ++--- editions/tw5.com/tiddlers/filters/tags.tid | 23 ++--- editions/tw5.com/tiddlers/filters/title.tid | 26 +++--- .../tw5.com/tiddlers/filters/untagged.tid | 26 +++--- .../howtos/Structuring TiddlyWiki.tid | 4 +- editions/tw5.com/tiddlers/howtos/Tagging.tid | 11 +-- .../releasenotes/beta/Release 5.0.14beta.tid | 6 +- .../styleguide/Documentation Macros.tid | 15 ++-- .../tw5.com/tiddlers/system/doc-macros.tid | 13 ++- .../tw5.com/tiddlers/system/doc-styles.tid | 30 ++++++- editions/tw5.com/tiddlers/system/if-macro.js | 26 ++++++ .../tiddlers/system/operator-macros.tid | 58 ++++++------- .../Creating journal tiddlers.tid | 4 +- 121 files changed, 1167 insertions(+), 711 deletions(-) delete mode 100644 editions/tw5.com/tiddlers/concepts/FilterParameters.tid create mode 100644 editions/tw5.com/tiddlers/concepts/HardAndSoftLinks.tid delete mode 100644 editions/tw5.com/tiddlers/concepts/ObservableLinks.tid create mode 100644 editions/tw5.com/tiddlers/concepts/OrderOfTaggedTiddlers.tid rename editions/tw5.com/tiddlers/concepts/{TitleSelections.tid => TitleSelection.tid} (83%) rename editions/tw5.com/tiddlers/{filters/dummies => demonstrations/Weekdays}/Days of the Week.tid (70%) rename editions/tw5.com/tiddlers/{filters/dummies => demonstrations/Weekdays}/Friday.tid (100%) rename editions/tw5.com/tiddlers/{filters/dummies => demonstrations/Weekdays}/Monday.tid (100%) rename editions/tw5.com/tiddlers/{filters/dummies => demonstrations/Weekdays}/Saturday.tid (100%) rename editions/tw5.com/tiddlers/{filters/dummies => demonstrations/Weekdays}/Sunday.tid (100%) rename editions/tw5.com/tiddlers/{filters/dummies => demonstrations/Weekdays}/Thursday.tid (51%) rename editions/tw5.com/tiddlers/{filters/dummies => demonstrations/Weekdays}/Tuesday.tid (100%) rename editions/tw5.com/tiddlers/{filters/dummies => demonstrations/Weekdays}/Wednesday.tid (100%) delete mode 100644 editions/tw5.com/tiddlers/filters/FilterSyntax.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/limit.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/links.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/list.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/listed.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/modules.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/moduletypes.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/next.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/nsort.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/nsortcs.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/nth.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/plugintiddlers.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/prefix.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/previous.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/regexp.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/removeprefix.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/removesuffix.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/rest.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/reverse.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/sameday.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/search.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/shadowsource.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/sort.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/sortcs.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/suffix.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/tag - Copy.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/tag.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/tagging.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/tags.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/title.tid create mode 100644 editions/tw5.com/tiddlers/filters/syntax/FilterExpression.tid create mode 100644 editions/tw5.com/tiddlers/filters/syntax/FilterParameter.tid create mode 100644 editions/tw5.com/tiddlers/filters/syntax/FilterRun.tid create mode 100644 editions/tw5.com/tiddlers/filters/syntax/FilterStep.tid create mode 100644 editions/tw5.com/tiddlers/filters/syntax/FilterSyntax.tid create mode 100644 editions/tw5.com/tiddlers/filters/syntax/FilterWhitespace.tid create mode 100644 editions/tw5.com/tiddlers/system/if-macro.js diff --git a/editions/tw5.com/tiddlers/concepts/AbsoluteOperators.tid b/editions/tw5.com/tiddlers/concepts/AbsoluteOperators.tid index 161c63691..b6736293b 100644 --- a/editions/tw5.com/tiddlers/concepts/AbsoluteOperators.tid +++ b/editions/tw5.com/tiddlers/concepts/AbsoluteOperators.tid @@ -1,11 +1,13 @@ created: 20150117204109000 -modified: 20150119190116000 +modified: 20150124185709000 tags: Concepts title: Absolute Operators type: text/vnd.tiddlywiki -The output of a filter step depends on its [[operator|Filter Operators]]: +The output of a [[filter|Filters]] step depends on its [[operator|Filter Operators]]: * Most operators perform <<.def relative>> to their input. They examine each input title in turn and filter out any that don't match. Such steps narrow down the output of a run. -* <<.def Absolute>> operators ignore their input and generate an independent output instead. <<.olink title>> is an example: the result of `[title[A]title[B]]` is `B`. But the <<.olink field>> operator is relative, so the result of `[title[A]field:title[B]` is empty. +* <<.def Absolute>> operators ignore their input and generate an independent output instead. + +A good example of an absolute operator is <<.olink title>>. The output of `[title[A]title[B]]` is just <<.tid B>>. But the <<.olink field>> operator is relative, so `[title[A]field:title[B]` outputs nothing at all. diff --git a/editions/tw5.com/tiddlers/concepts/DominantAppend.tid b/editions/tw5.com/tiddlers/concepts/DominantAppend.tid index 996cf9cf6..622c5e2a8 100644 --- a/editions/tw5.com/tiddlers/concepts/DominantAppend.tid +++ b/editions/tw5.com/tiddlers/concepts/DominantAppend.tid @@ -1,11 +1,11 @@ -created: 20151714300000000 -modified: 20150119191515000 +created: 20150123220223000 +modified: 20150124185028000 tags: Concepts title: Dominant Append type: text/vnd.tiddlywiki -A <<.def "dominant append">> is a frequent occurrence in [[filter|Filters]] processing. +[[Filters]] manipulate [[sets of titles|Title Selection]] in which no title may appear more than once. Furthermore, they often need to append one such set to another. -Filters manipulate [[selections|Title Selections]] in which no title can appear more than once, and they often append one selection to another. +This is done in such a way that, if a title would be duplicated, the earlier copy of that title is discarded. The titles being appended are dominant. -This is done in such a way that if the result would contain two copies of the same title, the <<.em earlier>> one is removed. The appended titles thus dominate over any earlier duplicates. +For example, if a selection contains `Andrew Becky Clara Daniel` and `Andrew Barney Clara Daisy` is then appended to it, the result is `Becky Daniel Andrew Barney Clara Daisy`. diff --git a/editions/tw5.com/tiddlers/concepts/FilterParameters.tid b/editions/tw5.com/tiddlers/concepts/FilterParameters.tid deleted file mode 100644 index 5bb828548..000000000 --- a/editions/tw5.com/tiddlers/concepts/FilterParameters.tid +++ /dev/null @@ -1,20 +0,0 @@ -created: 20151714300000000 -modified: 20150119185917000 -tags: Concepts -title: Filter Parameters -type: text/vnd.tiddlywiki - -The parameter to a [[filter operator|Filter Operators]] can be: - -;<<.def direct>> -: `[like this]` -: Literal, treated at face value -;<<.def indirect>> -:<<.def transcluded>> -:: `{like this}` -:: The value of a field of a specified tiddler, or the value of a property of a specified [[data tiddler|DataTiddlers]] -:<<.def variable>> -::`` -:: The value of the specified [[variable|Variables]] - -See [[Filter Syntax]]. diff --git a/editions/tw5.com/tiddlers/concepts/Filters.tid b/editions/tw5.com/tiddlers/concepts/Filters.tid index 9bc5ed6bc..d20f8d03a 100644 --- a/editions/tw5.com/tiddlers/concepts/Filters.tid +++ b/editions/tw5.com/tiddlers/concepts/Filters.tid @@ -1,5 +1,5 @@ created: 20130827080000000 -modified: 20150119191522000 +modified: 20150124183938000 tags: Reference Concepts title: Filters type: text/vnd.tiddlywiki @@ -7,7 +7,7 @@ list: [[Introduction to filter notation]] [[Filter Syntax]] You can think of TiddlyWiki as a database in which the records are tiddlers. A database typically provides a way of discovering which records match a given pattern, and in ~TiddlyWiki this is done with filters. -A <<.def filter>> is a concise notation for selecting a particular [[set of tiddlers|Title Selections]], known as its <<.def "output">>. Whenever ~TiddlyWiki encounters a filter, it calculates the output. Further work can then be done with just those tiddlers, such as [[counting|CountWidget]] or [[listing|ListWidget]] them. +A <<.def filter>> is a concise notation for selecting a particular [[set of tiddlers|Title Selection]], known as its <<.def "output">>. Whenever ~TiddlyWiki encounters a filter, it calculates the output. Further work can then be done with just those tiddlers, such as [[counting|CountWidget]] or [[listing|ListWidget]] them. The following example passes a filter to the [[list-links macro|ListMacro]] to display a list of all tiddlers whose titles start with the letter H: @@ -21,5 +21,5 @@ A filter's output can change as tiddlers are added and deleted in the wiki. ~Tid ;Find out more: * [[Introduction to filter notation]] -- a step-by-step walkthrough -* [[Filter Syntax]] -- the exact rules of the notation +* [[Filter Syntax]] -- the detailed technical rules * [[Filter Operators]] -- the available methods of filtering diff --git a/editions/tw5.com/tiddlers/concepts/HardAndSoftLinks.tid b/editions/tw5.com/tiddlers/concepts/HardAndSoftLinks.tid new file mode 100644 index 000000000..12e5d4402 --- /dev/null +++ b/editions/tw5.com/tiddlers/concepts/HardAndSoftLinks.tid @@ -0,0 +1,15 @@ +created: 20150123220237000 +modified: 20150124120447000 +tags: Concepts +title: Hard and Soft Links +type: text/vnd.tiddlywiki + +A <<.def "hard link">> is one that can be detected by a superficial examination of WikiText. + +A link is <<.def "soft">> if it is: + +* contained in text [[trancluded|Transclusion]] from elsewhere +* supplied via a [[macro|Macros]] or [[variable|Variables]] +* generated by a link widget whose <<.attr to>> attribute is a transclusion, macro or variable + +Soft links are not detected by link-related filter operators such as <<.olink backlinks>>, <<.olink links>>, <<.olink all>> and <<.olink is>>. diff --git a/editions/tw5.com/tiddlers/concepts/ObservableLinks.tid b/editions/tw5.com/tiddlers/concepts/ObservableLinks.tid deleted file mode 100644 index 076deeb2d..000000000 --- a/editions/tw5.com/tiddlers/concepts/ObservableLinks.tid +++ /dev/null @@ -1,20 +0,0 @@ -created: 20130825202900000 -modified: 20150117152438000 -tags: Concepts -title: Observable Links -type: text/vnd.tiddlywiki - -An <<.def "observable link">> is a [[link|TiddlerLinks]] whose presence can be detected by a superficial examination of WikiText. - -A link is <<.em not>> observable if it is: - -* contained in text [[transcluded|Transclusion]] from elsewhere -* supplied via [[Macros]] or [[Variables]] -* generated by a <<.wlink LinkWidget>> widget whose `to` attribute is a transclusion, macro or variable - -Unobservable links are <<.em ignored>> by the link-related [[Filter Operators]]: - -* <<.olink backlinks>> -* <<.olink links>> -* <<.olink2 "all[missing]" all>> -* <<.olink2 "all[orphans]" all>> diff --git a/editions/tw5.com/tiddlers/concepts/OrderOfTaggedTiddlers.tid b/editions/tw5.com/tiddlers/concepts/OrderOfTaggedTiddlers.tid new file mode 100644 index 000000000..1a7bb55e9 --- /dev/null +++ b/editions/tw5.com/tiddlers/concepts/OrderOfTaggedTiddlers.tid @@ -0,0 +1,15 @@ +created: 20150124125646000 +modified: 20150124202917000 +tags: Concepts +title: Order of Tagged Tiddlers + +When ~TiddlyWiki generates a list of the tiddlers that have a particular tag (e.g. the dropdown list of a tag pill), it orders the tiddlers using the following rules: + +# Start with any that are [[declared|Title List]] in the <<.field list>> field of the tag tiddler, in the order given there. + +# In each remaining tiddler <<.place T>>, look for a <<.field list-before>> field. If this has a tiddler title as its value, place <<.place T>> just <<.em before>> that one. +#* As a special case, if the field exists but its value is empty, place <<.place T>> at the very start of the list. + +# In each remaining tiddler <<.place T>>, look for a <<.field list-after>> field. If this has a tiddler title as its value, place tiddler <<.place T>> just <<.em after>> that one. + +# If any tiddlers still remain, place them at the end of the list. diff --git a/editions/tw5.com/tiddlers/concepts/RailroadDiagrams.tid b/editions/tw5.com/tiddlers/concepts/RailroadDiagrams.tid index 02ae03ffa..7dbec9c7b 100644 --- a/editions/tw5.com/tiddlers/concepts/RailroadDiagrams.tid +++ b/editions/tw5.com/tiddlers/concepts/RailroadDiagrams.tid @@ -1,8 +1,8 @@ created: 20150105133800000 -modified: 20150105134300000 -title: RailroadDiagrams +modified: 20150124181306000 +title: Railroad Diagrams -Railroad diagrams, sometimes called syntax diagrams, are a visual way of explaining the syntax rules of a computer language. Reading one is like reading a public transport map. +<<.def "Railroad diagrams">>, sometimes called <<.def "syntax diagrams">>, are a visual way of explaining the syntax rules of a computer language. Reading one is like reading a public transport map. Each diagram starts on the left and ends on the right. Simply follow any line from the startpoint to the endpoint. All the alternative lines are equally valid. A line will sometimes jump over an item that is optional, or loop back to indicate that an item can be repeated. @@ -14,4 +14,4 @@ In the example above, a comma appears between each occurrence of the `repeated` Characters in round boxes are literal, i.e. they denote themselves. A name in a rectangular box denotes a further railroad diagram. -The railroad diagrams on this site are generated with the [[Railroad Plugin]]. +The railroad diagrams in ~TiddlyWiki's documentation are generated with the [[Railroad Plugin]]. diff --git a/editions/tw5.com/tiddlers/concepts/TextReference.tid b/editions/tw5.com/tiddlers/concepts/TextReference.tid index 96ed27d11..61441f550 100644 --- a/editions/tw5.com/tiddlers/concepts/TextReference.tid +++ b/editions/tw5.com/tiddlers/concepts/TextReference.tid @@ -1,5 +1,5 @@ created: 201308270759 -modified: 201311011115 +modified: 20150124211238000 tags: Concepts title: TextReference @@ -14,7 +14,7 @@ Text references are made up of several parts, most of which can be optional: Text references can be used in several places: -* As IndirectOperands within [[Filters]] (eg, `<$list filter="[tag{MyTag!!name}]"/>`) +* As [[indirect parameters|Filter Parameter]] within [[Filters]] (eg, `<$list filter="[tag{MyTag!!name}]"/>`) * As IndirectAttributes of an element or widget (eg, `<$widget attrib={{Title!!description}}/>`) * As the operand of a shortcut transclusion (eg, `{{MyTiddler!!title}}`) * As the `state` attribute of the RevealWidget and the LinkCatcherWidget diff --git a/editions/tw5.com/tiddlers/concepts/TitleList.tid b/editions/tw5.com/tiddlers/concepts/TitleList.tid index db459af15..d9bbe8412 100644 --- a/editions/tw5.com/tiddlers/concepts/TitleList.tid +++ b/editions/tw5.com/tiddlers/concepts/TitleList.tid @@ -1,9 +1,9 @@ created: 20150117152418000 -modified: 20150119191533000 +modified: 20150124205659000 tags: Concepts -title: Title Lists +title: Title List -A <<.def "title list">> is a line of text that contians one or more tiddler titles, strung together with a space between each one and the next. +A <<.def "title list">> is a line of text that presents one or more tiddler titles, strung together with a space between each one and the next. If a title <<.em contains>> a space, it needs double square brackets around it: @@ -11,4 +11,4 @@ If a title <<.em contains>> a space, it needs double square brackets around it: Title lists are used in various places, including PermaLinks and the ListField. -They are in fact the simplest case of a [[filter|Filters]], and are thus a way of expressing a [[title selection|Title Selections]]. +They are in fact the simplest case of a [[filter|Filters]], and are thus a way of expressing a [[selection of titles|Title Selection]]. diff --git a/editions/tw5.com/tiddlers/concepts/TitleSelections.tid b/editions/tw5.com/tiddlers/concepts/TitleSelection.tid similarity index 83% rename from editions/tw5.com/tiddlers/concepts/TitleSelections.tid rename to editions/tw5.com/tiddlers/concepts/TitleSelection.tid index dee8a89e6..be3026865 100644 --- a/editions/tw5.com/tiddlers/concepts/TitleSelections.tid +++ b/editions/tw5.com/tiddlers/concepts/TitleSelection.tid @@ -1,10 +1,10 @@ created: 20150117152418000 -modified: 20150119191302000 +modified: 20150124202920000 tags: Concepts -title: Title Selections +title: Title Selection A <<.def "title selection">> is an ordered set of tiddler titles (or similar strings), in which no title appears more than once. Title selections are important in [[filter|Filters]] processing. -The simplest way to write one down is as a [[title list|Title Lists]]. +The simplest way to write one down is as a [[title list|Title List]]. diff --git a/editions/tw5.com/tiddlers/demonstrations/Tasks/Kill the Dragon.tid b/editions/tw5.com/tiddlers/demonstrations/Tasks/Kill the Dragon.tid index 783439f2f..c79e52399 100644 --- a/editions/tw5.com/tiddlers/demonstrations/Tasks/Kill the Dragon.tid +++ b/editions/tw5.com/tiddlers/demonstrations/Tasks/Kill the Dragon.tid @@ -1,6 +1,7 @@ created: 201308251431 -modified: 201308251431 +modified: 20150124131347000 tags: task title: Kill the Dragon +list-before: Get the Ring //This is a sample task for the TaskManagementExample// diff --git a/editions/tw5.com/tiddlers/demonstrations/Tasks/task.tid b/editions/tw5.com/tiddlers/demonstrations/Tasks/task.tid index d6630a575..62a1be33d 100644 --- a/editions/tw5.com/tiddlers/demonstrations/Tasks/task.tid +++ b/editions/tw5.com/tiddlers/demonstrations/Tasks/task.tid @@ -1,6 +1,7 @@ color: #8d9ac3 created: 201308252132 -modified: 201308252132 +modified: 20150124123528000 title: task +list: [[Make the beds]] -Sample tasks for the TaskManagementExample. \ No newline at end of file +Sample tasks for the TaskManagementExample. diff --git a/editions/tw5.com/tiddlers/filters/dummies/Days of the Week.tid b/editions/tw5.com/tiddlers/demonstrations/Weekdays/Days of the Week.tid similarity index 70% rename from editions/tw5.com/tiddlers/filters/dummies/Days of the Week.tid rename to editions/tw5.com/tiddlers/demonstrations/Weekdays/Days of the Week.tid index edb5514b6..ae0a105a9 100644 --- a/editions/tw5.com/tiddlers/filters/dummies/Days of the Week.tid +++ b/editions/tw5.com/tiddlers/demonstrations/Weekdays/Days of the Week.tid @@ -1,8 +1,10 @@ created: 20150117192110000 -modified: 20150118132010000 +modified: 20150123214636000 title: Days of the Week type: text/vnd.tiddlywiki list: Monday Tuesday Wednesday Thursday Friday Saturday Sunday +short: Mon Tue Wed Thu Fri Sat Sun +my-special-list: [[listed Operator (Examples)]] <<.this-is-operator-example>> diff --git a/editions/tw5.com/tiddlers/filters/dummies/Friday.tid b/editions/tw5.com/tiddlers/demonstrations/Weekdays/Friday.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/dummies/Friday.tid rename to editions/tw5.com/tiddlers/demonstrations/Weekdays/Friday.tid diff --git a/editions/tw5.com/tiddlers/filters/dummies/Monday.tid b/editions/tw5.com/tiddlers/demonstrations/Weekdays/Monday.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/dummies/Monday.tid rename to editions/tw5.com/tiddlers/demonstrations/Weekdays/Monday.tid diff --git a/editions/tw5.com/tiddlers/filters/dummies/Saturday.tid b/editions/tw5.com/tiddlers/demonstrations/Weekdays/Saturday.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/dummies/Saturday.tid rename to editions/tw5.com/tiddlers/demonstrations/Weekdays/Saturday.tid diff --git a/editions/tw5.com/tiddlers/filters/dummies/Sunday.tid b/editions/tw5.com/tiddlers/demonstrations/Weekdays/Sunday.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/dummies/Sunday.tid rename to editions/tw5.com/tiddlers/demonstrations/Weekdays/Sunday.tid diff --git a/editions/tw5.com/tiddlers/filters/dummies/Thursday.tid b/editions/tw5.com/tiddlers/demonstrations/Weekdays/Thursday.tid similarity index 51% rename from editions/tw5.com/tiddlers/filters/dummies/Thursday.tid rename to editions/tw5.com/tiddlers/demonstrations/Weekdays/Thursday.tid index ba051a8a8..208e2c863 100644 --- a/editions/tw5.com/tiddlers/filters/dummies/Thursday.tid +++ b/editions/tw5.com/tiddlers/demonstrations/Weekdays/Thursday.tid @@ -1,5 +1,5 @@ created: 20150117192116000 -modified: 20150118131552000 +modified: 20150124204253000 title: Thursday type: text/vnd.tiddlywiki @@ -9,5 +9,5 @@ type: text/vnd.tiddlywiki <<.using-days-of-week>> -<<.operator-example "[list[Days of the Week]before{!!title}]">> -<<.operator-example "[list[Days of the Week]after{!!title}]">> +<<.operator-example 1 "[list[Days of the Week]before{!!title}]">> +<<.operator-example 2 "[list[Days of the Week]after{!!title}]">> diff --git a/editions/tw5.com/tiddlers/filters/dummies/Tuesday.tid b/editions/tw5.com/tiddlers/demonstrations/Weekdays/Tuesday.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/dummies/Tuesday.tid rename to editions/tw5.com/tiddlers/demonstrations/Weekdays/Tuesday.tid diff --git a/editions/tw5.com/tiddlers/filters/dummies/Wednesday.tid b/editions/tw5.com/tiddlers/demonstrations/Weekdays/Wednesday.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/dummies/Wednesday.tid rename to editions/tw5.com/tiddlers/demonstrations/Weekdays/Wednesday.tid diff --git a/editions/tw5.com/tiddlers/fields/ListField.tid b/editions/tw5.com/tiddlers/fields/ListField.tid index 91eb5b17c..340a11d2b 100644 --- a/editions/tw5.com/tiddlers/fields/ListField.tid +++ b/editions/tw5.com/tiddlers/fields/ListField.tid @@ -1,11 +1,11 @@ created: 20130830092500000 -modified: 20150119191334000 +modified: 20150124202924000 tags: Fields title: ListField caption: list type: text/vnd.tiddlywiki -The `list` [[field of a tiddler|TiddlerFields]] is an optional feature that can be used to help structure your content. Its value is a [[title list|Title Lists]], and it can be used in several ways: +The `list` [[field of a tiddler|TiddlerFields]] is an optional feature that can be used to help structure your content. Its value is a [[title list|Title List]], and it can be used in several ways: * The `list` field of a tiddler that is being used as a tag determines the ordering of the tiddlers that carry that tag - see [[Tagging]] for details * The `list` [[filter|Filters]] selects the entries from a list diff --git a/editions/tw5.com/tiddlers/filters/FilterOperators.tid b/editions/tw5.com/tiddlers/filters/FilterOperators.tid index b192bf5e0..80b3755ab 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperators.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperators.tid @@ -1,24 +1,42 @@ created: 20140410103123179 -modified: 20150119190404000 +modified: 20150124200331000 tags: Concepts Filters title: Filter Operators type: text/vnd.tiddlywiki -A <<.def "filter operator">> is a predefined name attached to an individual step in a [[filter|Filters]]. It defines the particular action of that step. +\define .operator-rows(filter) +<$list filter="$filter$"> +<$link to={{!!title}}>{{!!caption}} +{{!!purpose}} <$list filter="[all[current]tag[Common Operators]]">{{$:/core/images/done-button}} +<$list filter="[all[current]tag[Negatable Operators]]">`!` + +\end - +\define .group-heading(_) + +\end + +A <<.def "filter operator">> is a predefined keyword attached to an individual [[step|Filter Step]] of a [[filter|Filters]]. It defines the particular action of that step. + +The following table lists all the core operators. The commonest ones are checkmarked. The third column indicates which operators allow <$link to="Filter Step">the ! prefix to reverse their meaning. + +
$_$
- + -<$list filter="[tag[Filter Operators]sort[]]"> - - - - +<<.operator-rows "[tag[Filter Operators]!tag[Order Operators]!tag[String Operators]!tag[Tag Operators]!tag[Special Operators]sort[]]">> +<<.group-heading "Order Operators">> +<<.operator-rows "[tag[Filter Operators]tag[Order Operators]!tag[String Operators]!tag[Tag Operators]!tag[Special Operators]sort[]]">> +<<.group-heading "String Operators">> +<<.operator-rows "[tag[Filter Operators]!tag[Order Operators]tag[String Operators]!tag[Tag Operators]!tag[Special Operators]sort[]]">> +<<.group-heading "Tag Operators">> +<<.operator-rows "[tag[Filter Operators]!tag[Order Operators]!tag[String Operators]tag[Tag Operators]!tag[Special Operators]sort[]]">> +<<.group-heading "Special Operators">> +<<.operator-rows "[tag[Filter Operators]!tag[Order Operators]!tag[String Operators]!tag[Tag Operators]tag[Special Operators]sort[]]">>
Operator PurposeCommonNeg
<$link to={{!!title}}>{{!!caption}}{{!!purpose}}<$list filter="[all[current]tag[Common Operators]]">{{$:/core/images/done-button}}
-A typical step is written as `[operator[parameter]]`, although not all of the operators need a [[parameter|Filter Parameters]]. +A typical step is written as `[operator[parameter]]`, although not all of the operators need a [[parameter|Filter Parameter]]. -Most steps accept a [[selection|Selection]] of tiddler titles as their input. For the exact rules, see [[Filter Syntax]]. +Most steps process the [[selection of titles|Title Selection]] that are supplied as their input, but a few are [[absolute|Absolute Operators]]. For the exact rules, see [[Filter Syntax]]. diff --git a/editions/tw5.com/tiddlers/filters/FilterSyntax.tid b/editions/tw5.com/tiddlers/filters/FilterSyntax.tid deleted file mode 100644 index 5f49ad6e3..000000000 --- a/editions/tw5.com/tiddlers/filters/FilterSyntax.tid +++ /dev/null @@ -1,87 +0,0 @@ -created: 20140210141217955 -modified: 20150119191956000 -tags: Filters -title: Filter Syntax -type: text/vnd.tiddlywiki - -<<.preamble """[[Filters]] follow a grammar that is presented here, using [[RailroadDiagrams]], for those who find formal syntax descriptions helpful. However, you can [[learn to write filters|Introduction to filter notation]] without needing to understand this tiddler.""">> - -A <<.def filter>> is a pipeline for transforming an <<.def input>> into an <<.def output>>. Both the input and the output are [[ordered sets|Title Selections]] of tiddler titles or similar strings. - -Filters are built from smaller pieces, called ''runs'' and ''steps'', each of which also transforms an input to an output. - ---- - -;filter -: <$railroad text=""" -[{: [:whitespace] ("+"|:-|"-") run }] -"""/> - -A filter starts with an empty output. Its runs are processed from left to right, progressively modifying the output. - -A run's input is normally a list of all the non-shadow tiddler titles in the wiki (in no particular order). But the `+` prefix can change this. - -* If a run has no `+` or `-` prefix, its output titles are [[dominantly appended|Dominant Append]] to the filter's output. -* If a run has a `-` prefix, its output titles are <<.em removed>> from the filter's output (if they were present). -* If a run has a `+` prefix, it receives the filter's output so far as its input. The filter's output is then completely <<.em replaced>> by the run's output. Any subsequent run reverts to receiving all tiddler titles as its input, unless it too has a `+` prefix. - -In concise technical terms: - -|!Run |!Interpretation |!Output | -|`run` |union of sets |... OR run | -|`+run` |intersection of sets |... AND run | -|`-run` |difference of sets |... AND NOT run | - ---- - -;run -: <$railroad text=""" -( "[" {step} "]" - | - [:{/"anything but [ ] or whitespace"/}] - | - '"' [:{/'anything but "'/}] '"' - | - "'" [:{/"anything but '"/}] '"' -) -"""/> - -The steps of a run are processed from left to right. The input to the first step is same as the input to the run. For each subsequent step, the input is the output of the previous step. - -{{Absolute Operators}} - -The lower three options in the diagram match `HelloThere`, `"HelloThere"` and `'HelloThere'`, and are short for `[title[HelloThere]]`. The two quoted options exist to support titles that contain square brackets: `"An [[[[Unusual]]]] Tiddler"`. - ---- - -;step -: <$railroad text=""" -[:"!"] [:operator [:":" suffix] ] parameter -"""/> - -The <<.def operator>> is drawn from a list of [[predefined names|Filter Operators]], which can be extended by plugins. Any unrecognised operator is treated as if it was the suffix to the <<.olink field>> operator. If a step's operator is omitted altogether, it defaults to `title`. - -The <<.def suffix>> is additional text, usually the name of a [[field|TiddlerFields]], that extends the meaning of certain operators. - ---- - -;parameter -: <$railroad text=""" -( "[" [:{/"anything but ]"/}] "]" - | - "{" [:{/"anything but }"/}] "}" - | - "<" [:{/"anything but >"/}] ">" -) -"""/> - -* `[`...`]` encloses a direct parameter -* `{`...`}` encloses a transcluded parameter -* `<`...`>` encloses a [[variable|Variables]] parameter - ---- - -;whitespace -: <$railroad text=""" -{( "space" | "tab" | "linefeed" | "return" | "vertical tab" | "formfeed" )} -"""/> diff --git a/editions/tw5.com/tiddlers/filters/Introduction to Filters.tid b/editions/tw5.com/tiddlers/filters/Introduction to Filters.tid index 532f9f6f5..c0bf8b2ba 100644 --- a/editions/tw5.com/tiddlers/filters/Introduction to Filters.tid +++ b/editions/tw5.com/tiddlers/filters/Introduction to Filters.tid @@ -1,10 +1,12 @@ created: 20140410101941871 -modified: 20150117180519000 +modified: 20150124183957000 tags: Learning Filters title: Introduction to filter notation type: text/vnd.tiddlywiki -<<.preamble """This explains the basics of writing a [[filter|Filters]] to select a set of tiddlers. For a more technical summary, see [[Filter Syntax]].)""">> +<<.preamble """This explains the basics of writing a [[filter|Filters]] to select a set of tiddlers. For a more technical presentation, see [[Filter Syntax]].""">> + +<$macrocall $name=".note" _="""Filters do nothing if you just type them into a tiddler on their own. They need a context. An easy way to experiment with filters is to type them into the <<.advancedsearch-tab Filter>> tab of [[Advanced Search|$:/AdvancedSearch]]."""/> The simplest case is where you already know exactly which tiddlers you want. Type each title in double square brackets, with a space between each one and the next: diff --git a/editions/tw5.com/tiddlers/filters/addprefix.tid b/editions/tw5.com/tiddlers/filters/addprefix.tid index f06ca4ca0..97b3aa7ba 100644 --- a/editions/tw5.com/tiddlers/filters/addprefix.tid +++ b/editions/tw5.com/tiddlers/filters/addprefix.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20150119192731000 +modified: 20150124172110000 tags: [[Filter Operators]] [[String Operators]] title: addprefix Operator type: text/vnd.tiddlywiki @@ -7,10 +7,10 @@ caption: addprefix purpose: extend each input title with a prefix <$macrocall $name=".operator-def" -input="a [[title selection|Title Selections]]" -parameter="a prefix to be added" -paramName="p" -output="a copy of the input, but with <<.place p>> added to the start of each title" +input="a [[selection of titles|Title Selection]]" +parameter="a string of characters" +paramName="s" +output="the input, but with <<.place s>> added to the start of each title" /> <<.operator-examples "addprefix">> diff --git a/editions/tw5.com/tiddlers/filters/addsuffix.tid b/editions/tw5.com/tiddlers/filters/addsuffix.tid index a50f01051..6d1c5624d 100644 --- a/editions/tw5.com/tiddlers/filters/addsuffix.tid +++ b/editions/tw5.com/tiddlers/filters/addsuffix.tid @@ -1,5 +1,5 @@ created: 20140828133830424 -modified: 20150119192734000 +modified: 20150124172115000 tags: [[Filter Operators]] [[String Operators]] title: addsuffix Operator type: text/vnd.tiddlywiki @@ -7,10 +7,10 @@ caption: addsuffix purpose: extend each input title with a suffix <$macrocall $name=".operator-def" -input="a [[title selection|Title Selections]]" -parameter="a suffix to be added" -paramName="p" -output="a copy of the input, but with <<.place p>> added to the end of each title" +input="a [[selection of titles|Title Selection]]" +parameter="a string of characters" +paramName="s" +output="the input, but with <<.place s>> added to the end of each title" /> <<.operator-examples "addsuffix">> diff --git a/editions/tw5.com/tiddlers/filters/after.tid b/editions/tw5.com/tiddlers/filters/after.tid index 1dba30173..dcd374e76 100644 --- a/editions/tw5.com/tiddlers/filters/after.tid +++ b/editions/tw5.com/tiddlers/filters/after.tid @@ -1,18 +1,18 @@ created: 20140512103123179 -modified: 20150119192331000 -tags: [[Filter Operators]] [[List Operators]] +modified: 20150124204353000 +tags: [[Filter Operators]] [[Order Operators]] title: after Operator type: text/vnd.tiddlywiki caption: after -purpose: get the title that follows a particular one in the input +purpose: find which input title follows a specified one <$macrocall $name=".operator-def" -input="a [[title selection|Title Selections]]" +input="a [[selection of titles|Title Selection]]" parameter="one of those titles" -paramName="p" -output="the title that immediately follows <<.place p>> in the input" +paramName="t" +output="the title that immediately follows <<.place t>> in the input" /> -If <<.place p>> is not present in the input, or is the last item there, then the output is empty. +If <<.place t>> is not present in the input, or is the last title there, then the output is empty. <<.operator-examples "after">> diff --git a/editions/tw5.com/tiddlers/filters/all.tid b/editions/tw5.com/tiddlers/filters/all.tid index ed08432f8..39e250be7 100644 --- a/editions/tw5.com/tiddlers/filters/all.tid +++ b/editions/tw5.com/tiddlers/filters/all.tid @@ -1,19 +1,18 @@ created: 20140410103123179 -modified: 20150119191633000 -tags: [[Filter Operators]] [[Common Operators]] [[Absolute Operators]] [[Category Operators]] +modified: 20150124200847000 +tags: [[Filter Operators]] [[Common Operators]] [[Absolute Operators]] title: all Operator type: text/vnd.tiddlywiki caption: all -purpose: get all tiddlers of a basic category +purpose: find all titles of a fundamental category <$macrocall $name=".operator-def" -input="ignored, unless <<.place p>> is empty" -parameter="see below" -paramName="p" -output="the complete [[selection|Title Selections]] of tiddler titles that belong to one or more basic categories" +input="ignored, unless the parameter is empty" +parameter="zero or more categories -- see below" +output="the titles that belong to all the specified categories" /> -The parameter specifies tiddler categories using the following syntax: +The parameter specifies zero or more fundamental categories using the following syntax: <$railroad text=""" [{: ("current" | "missing" |: "orphans" | "shadows" | "tiddlers" ) +"+" }] @@ -21,15 +20,15 @@ The parameter specifies tiddler categories using the following syntax: |!Category |!Members |!Sorted | |^`current` |just the [[current tiddler|CurrentTiddler]] |^-- | -|^`missing` |all non-existent tiddlers to which there is at least one [[observable link|Observable Links]] |^no | -|^`orphans` |all tiddlers to which there are <<.em no>> observable links |^by title | +|^`missing` |all non-existent tiddlers to which there is at least one [[hard link|Hard and Soft Links]] |^no | +|^`orphans` |all tiddlers to which there are <<.em no>> hard links |^by title | |^`shadows` |all the [[shadow tiddlers|ShadowTiddlers]] that exist, including any that have been overridden with non-shadow tiddlers |^no | |^`tiddlers` |all the non-shadow tiddlers that exist |no | If the parameter specifies more than one category, they are processed from left to right. The overall output is initially empty, and each category's output is [[dominantly appended|Dominant Append]] to it in turn. Unrecognised categories contribute nothing to the output. -As a special case, if there is no parameter, the output is simply a copy of the input. This can be useful when the parameter is [[supplied indirectly|Filter Parameters]]. +As a special case, if the parameter is empty, the output is simply a copy of the input. This can be useful when the parameter is [[soft|Filter Parameter]]. -The <<.op is>> operator is similar, but its scope is restricted to its input tiddlers. +The <<.olink is>> operator is similar, but its scope is restricted to its input. <<.operator-examples "all">> diff --git a/editions/tw5.com/tiddlers/filters/backlinks.tid b/editions/tw5.com/tiddlers/filters/backlinks.tid index 5a5161ebf..234d2e7d5 100644 --- a/editions/tw5.com/tiddlers/filters/backlinks.tid +++ b/editions/tw5.com/tiddlers/filters/backlinks.tid @@ -1,17 +1,17 @@ created: 20140410103123179 -modified: 20150119192416000 -tags: [[Filter Operators]] [[Link Operators]] +modified: 20150124200946000 +tags: [[Filter Operators]] title: backlinks Operator type: text/vnd.tiddlywiki caption: backlinks -purpose: get the tiddlers that link to each input tiddler +purpose: find the titles that link to each input title <$macrocall $name=".operator-def" -input="a [[title selection|Title Selections]]" +input="a [[selection of titles|Title Selection]]" parameter="none" -output="the titles of any non-system tiddlers that contain [[Observable Links]] to the input tiddlers" +output="any non-[[system|SystemTiddlers]] titles that contain [[hard links|Hard and Soft Links]] to the input titles" /> -Each input tiddler is processed in turn. Its corresponding list of backlinks is generated, sorted by title, and then [[dominantly appended|Dominant Append]] to the operator's overall output. +Each input title is processed in turn. The corresponding tiddler's list of backlinks is generated, sorted alphabetically by title, and then [[dominantly appended|Dominant Append]] to the operator's overall output. <<.operator-examples "backlinks">> diff --git a/editions/tw5.com/tiddlers/filters/before.tid b/editions/tw5.com/tiddlers/filters/before.tid index 2c4b38791..fc70c7905 100644 --- a/editions/tw5.com/tiddlers/filters/before.tid +++ b/editions/tw5.com/tiddlers/filters/before.tid @@ -1,18 +1,18 @@ created: 20140512103123179 -modified: 20150119192411000 -tags: [[Filter Operators]] [[List Operators]] +modified: 20150124164952000 +tags: [[Filter Operators]] [[Order Operators]] caption: before title: before Operator type: text/vnd.tiddlywiki -purpose: get the title that precedes a particular one in the input +purpose: find which input title precedes a specified one <$macrocall $name=".operator-def" -input="a [[title selection|Title Selections]]" +input="a [[selection of titles|Title Selection]]" parameter="one of those titles" -paramName="p" -output="the title that immediately precedes <<.place p>> in the input" +paramName="t" +output="the title that immediately precedes <<.place t>> in the input" /> -If <<.place p>> is not present in the input, or is the first title there, then the output is empty. +If <<.place t>> is not present in the input, or is the first title there, then the output is empty. <<.operator-examples "before">> diff --git a/editions/tw5.com/tiddlers/filters/bf.tid b/editions/tw5.com/tiddlers/filters/bf.tid index e2a40de87..4420432e6 100644 --- a/editions/tw5.com/tiddlers/filters/bf.tid +++ b/editions/tw5.com/tiddlers/filters/bf.tid @@ -1,6 +1,6 @@ created: 20140410103123179 -modified: 20150118182927000 -tags: [[Filter Operators]] [[List Operators]] +modified: 20150124200504000 +tags: [[Filter Operators]] [[Order Operators]] title: bf Operator type: text/vnd.tiddlywiki caption: bf diff --git a/editions/tw5.com/tiddlers/filters/butfirst.tid b/editions/tw5.com/tiddlers/filters/butfirst.tid index e4544fb01..bbc7f9b86 100644 --- a/editions/tw5.com/tiddlers/filters/butfirst.tid +++ b/editions/tw5.com/tiddlers/filters/butfirst.tid @@ -1,6 +1,6 @@ created: 20140410103123179 -modified: 20150118183016000 -tags: [[Filter Operators]] [[Sequence Operators]] +modified: 20150124200507000 +tags: [[Filter Operators]] [[Order Operators]] title: butfirst Operator type: text/vnd.tiddlywiki caption: butfirst diff --git a/editions/tw5.com/tiddlers/filters/butlast.tid b/editions/tw5.com/tiddlers/filters/butlast.tid index e9fdbf0a1..55452f56f 100644 --- a/editions/tw5.com/tiddlers/filters/butlast.tid +++ b/editions/tw5.com/tiddlers/filters/butlast.tid @@ -1,16 +1,16 @@ created: 20140410103123179 -modified: 20150119192424000 -tags: [[Filter Operators]] [[Sequence Operators]] +modified: 20150124172210000 +tags: [[Filter Operators]] [[Order Operators]] title: butlast Operator type: text/vnd.tiddlywiki caption: butlast -purpose: get all the but last <<.place n>> input titles +purpose: discard the last <<.place n>> input titles <$macrocall $name=".operator-def" -input="a [[title selection|Title Selections]]" +input="a [[selection of titles|Title Selection]]" parameter="an integer, defaulting to 1" paramName="n" -output="all but the last <<.place n>> titles from the input" +output="all but the last <<.place n>> input titles" /> <<.operator-examples "butlast">> diff --git a/editions/tw5.com/tiddlers/filters/commands.tid b/editions/tw5.com/tiddlers/filters/commands.tid index 4152f8266..de6b2abe0 100644 --- a/editions/tw5.com/tiddlers/filters/commands.tid +++ b/editions/tw5.com/tiddlers/filters/commands.tid @@ -1,16 +1,15 @@ created: 20140410103123179 -modified: 20150119191708000 -tags: [[Filter Operators]] [[Non-Tiddler Operators]] [[Absolute Operators]] +modified: 20150124155303000 +tags: [[Filter Operators]] [[Special Operators]] [[Absolute Operators]] title: commands Operator type: text/vnd.tiddlywiki caption: commands -purpose: get all the Node.js commands +purpose: select the titles of all the Node.js commands <$macrocall $name=".operator-def" input="ignored" parameter="none" -output="the [[selection|Title Selections]] of [[commands|Commands]] that can be given to [[TiddlyWiki on Node.js]]" +output="the [[command words|Commands]] that can be given to [[TiddlyWiki on Node.js]]" /> <<.operator-examples "commands">> - diff --git a/editions/tw5.com/tiddlers/filters/each.tid b/editions/tw5.com/tiddlers/filters/each.tid index b6c15b1d5..4f381fc20 100644 --- a/editions/tw5.com/tiddlers/filters/each.tid +++ b/editions/tw5.com/tiddlers/filters/each.tid @@ -1,18 +1,20 @@ created: 20140410103123179 -modified: 20150119192427000 +modified: 20150124164957000 tags: [[Filter Operators]] [[Group Operators]] title: each Operator type: text/vnd.tiddlywiki caption: each -purpose: get one of each group of input tiddlers by field value +purpose: select one of each group of input titles by field <$macrocall $name=".operator-def" -input="a [[title selection|Title Selections]]" +input="a [[selection of titles|Title Selection]]" parameter="the name of a [[field|TiddlerFields]]" paramName="f" -output="a [[selection|Title Selections]] containing the first tiddler found with each distinct value for field <<.place f>>" +output="a selection containing the first input title encountered for each distinct value of field <<.place f>>" /> -Each input tiddler is processed in turn. The value of field <<.place f>> in that tiddler is examined, and as long as the value has not been encountered before, the tiddler's title is appended to the output set. +Each input title is processed in turn. The value of field <<.place f>> in the corresponding tiddler is examined, and as long as the value has not been encountered before, the title is appended to the output set. + +If a tiddler doesn't contain field <<.place f>>, or contains it but with an empty value, then it contributes nothing to the output. <<.operator-examples "each">> diff --git a/editions/tw5.com/tiddlers/filters/eachday.tid b/editions/tw5.com/tiddlers/filters/eachday.tid index 86fb3659d..b1fcdb712 100644 --- a/editions/tw5.com/tiddlers/filters/eachday.tid +++ b/editions/tw5.com/tiddlers/filters/eachday.tid @@ -1,18 +1,20 @@ created: 20140410103123179 -modified: 20150119192430000 -tags: [[Filter Operators]] [[Group Operators]] +modified: 20150124164959000 +tags: [[Filter Operators]] [[Group Operators]] [[Date Operators]] title: eachday Operator type: text/vnd.tiddlywiki caption: eachday -purpose: get one of each group of input tiddlers by date +purpose: select one of each group of input titles by date <$macrocall $name=".operator-def" -input="a [[selection|Title Selections]] of tiddler titles" -parameter="the name of a [[date field|DateFields]]" +input="a [[selection of titles|Title Selection]]" +parameter="the name of a date [[field|TiddlerFields]]" paramName="f" -output="a [[selection|Title Selections]] containing the first tiddler found with each distinct value (ignoring times of day) for field <<.place f>>" +output="a selection containing the first input title encountered for each distinct value (ignoring times of day) of field <<.place f>>" /> -Each input tiddler is processed in turn. The value of field <<.place f>> in that tiddler is examined, and as long as this indicates a date that has not been encountered before, the tiddler's title is appended to the output set. +Each input title is processed in turn. The value of field <<.place f>> in the corresponding tiddler is examined, and as long as this indicates a date that has not been encountered before, the title is appended to the output set. + +If a tiddler doesn't contain field <<.place f>>, it contributes nothing to the output. <<.operator-examples "eachday">> diff --git a/editions/tw5.com/tiddlers/filters/editiondescription.tid b/editions/tw5.com/tiddlers/filters/editiondescription.tid index 68c5b1401..c538ea3af 100644 --- a/editions/tw5.com/tiddlers/filters/editiondescription.tid +++ b/editions/tw5.com/tiddlers/filters/editiondescription.tid @@ -1,13 +1,13 @@ created: 20150111145738451 -modified: 20150119192433000 -tags: [[Filter Operators]] [[Non-Tiddler Operators]] [[Node.js Operators]] +modified: 20150124165002000 +tags: [[Filter Operators]] [[Special Operators]] title: editiondescription Operator type: text/vnd.tiddlywiki caption: editiondescription -purpose: get the descriptions of the input ~TiddlyWiki editions +purpose: select the descriptions of the input editions <$macrocall $name=".operator-def" -input="a [[selection|Title Selections]] of edition names" +input="a [[selection|Title Selection]] of edition names" parameter="none" output="the description string of each edition in the input" /> diff --git a/editions/tw5.com/tiddlers/filters/editions.tid b/editions/tw5.com/tiddlers/filters/editions.tid index 455ea99be..f7ce355e6 100644 --- a/editions/tw5.com/tiddlers/filters/editions.tid +++ b/editions/tw5.com/tiddlers/filters/editions.tid @@ -1,13 +1,13 @@ created: 20150111145738451 -modified: 20150118183042000 -tags: [[Filter Operators]] [[Non-Tiddler Operators]] [[Node.js Operators]] [[Absolute Operators]] +modified: 20150124150912000 +tags: [[Filter Operators]] [[Special Operators]] [[Absolute Operators]] title: editions Operator type: text/vnd.tiddlywiki caption: editions -purpose: get the names of all ~TiddlyWiki editions +purpose: select the names of all the ~TiddlyWiki editions <$macrocall $name=".operator-def" -input="none" +input="ignored" parameter="none" output="the name of each ~TiddlyWiki edition, in alphabetical order" /> diff --git a/editions/tw5.com/tiddlers/filters/examples/get.tid b/editions/tw5.com/tiddlers/filters/examples/get.tid index a1bae36e0..c49d876d6 100644 --- a/editions/tw5.com/tiddlers/filters/examples/get.tid +++ b/editions/tw5.com/tiddlers/filters/examples/get.tid @@ -1,8 +1,9 @@ created: 20150118134611000 -modified: 20150118183215000 +modified: 20150124201839000 tags: [[get Operator]] [[Operator Examples]] title: get Operator (Examples) type: text/vnd.tiddlywiki <<.operator-example 1 "[all[current]get[draft.of]]" "the title of the tiddler of which the current tiddler is a draft">> <<.operator-example 2 "[get[tags]]">> +<<.operator-example 3 "[each[tags]get[tags]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/limit.tid b/editions/tw5.com/tiddlers/filters/examples/limit.tid new file mode 100644 index 000000000..584baf509 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/limit.tid @@ -0,0 +1,8 @@ +created: 20150118134611000 +modified: 20150123214304000 +tags: [[limit Operator]] [[Operator Examples]] +title: limit Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[sort[modified]!limit[20]]" "the 20 most recently modified tiddlers">> +<<.operator-example 2 "[has[created]sort[created]limit[10]]" "the oldest 10 tiddlers in the wiki">> diff --git a/editions/tw5.com/tiddlers/filters/examples/links.tid b/editions/tw5.com/tiddlers/filters/examples/links.tid new file mode 100644 index 000000000..218c8233f --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/links.tid @@ -0,0 +1,14 @@ +created: 20150118134611000 +modified: 20150124202748000 +tags: [[links Operator]] [[Operator Examples]] +title: links Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[[HelloThere]links[]]">> +<<.operator-example 2 "[all[current]links[]]" "tiddlers [[hard-linked|Hard and Soft Links]] from the current one">> + +Here are some hard links: + +* HelloThere +* [[Filter Operators]] +* [[links Operator]] diff --git a/editions/tw5.com/tiddlers/filters/examples/list.tid b/editions/tw5.com/tiddlers/filters/examples/list.tid new file mode 100644 index 000000000..05f886045 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/list.tid @@ -0,0 +1,10 @@ +created: 20150118134611000 +modified: 20150123214445000 +tags: [[list Operator]] [[Operator Examples]] +title: list Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[HelloThere]]">> +<<.operator-example 2 "[list[Days of the Week!!short]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/listed.tid b/editions/tw5.com/tiddlers/filters/examples/listed.tid new file mode 100644 index 000000000..021a9946e --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/listed.tid @@ -0,0 +1,8 @@ +created: 20150118134611000 +modified: 20150123214616000 +tags: [[listed Operator]] [[Operator Examples]] +title: listed Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[[HelloThere]listed[]]">> +<<.operator-example 2 "[all[current]listed[my-special-list]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/modules.tid b/editions/tw5.com/tiddlers/filters/examples/modules.tid new file mode 100644 index 000000000..cdd319186 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/modules.tid @@ -0,0 +1,7 @@ +created: 20150123221510000 +modified: 20150123221534000 +tags: [[modules Operator]] [[Operator Examples]] +title: modules Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[[filteroperator]modules[]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/moduletypes.tid b/editions/tw5.com/tiddlers/filters/examples/moduletypes.tid new file mode 100644 index 000000000..09aaa69ac --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/moduletypes.tid @@ -0,0 +1,7 @@ +created: 20150123221601000 +modified: 20150123221623000 +tags: [[moduletypes Operator]] [[Operator Examples]] +title: moduletypes Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[moduletypes[]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/next.tid b/editions/tw5.com/tiddlers/filters/examples/next.tid new file mode 100644 index 000000000..7bb268de2 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/next.tid @@ -0,0 +1,11 @@ +created: 20150123221711000 +modified: 20150123221834000 +tags: [[next Operator]] [[Operator Examples]] +title: next Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[[Monday]next[Days of the Week]]">> +<<.operator-example 2 "[[Sunday]next[Days of the Week]]">> +<<.operator-example 3 "Tuesday Wednesday Thursday +[next[Days of the Week]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/nsort.tid b/editions/tw5.com/tiddlers/filters/examples/nsort.tid new file mode 100644 index 000000000..1c8f67125 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/nsort.tid @@ -0,0 +1,8 @@ +created: 20150123221921000 +modified: 20150123222142000 +tags: [[nsort Operator]] [[Operator Examples]] +title: nsort Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "10 010 1000 100 +[nsort[]]">> +<<.operator-example 2 "10 010 ALPHA beta alpha 1000 100 +[nsort[]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/nsortcs.tid b/editions/tw5.com/tiddlers/filters/examples/nsortcs.tid new file mode 100644 index 000000000..9bab28058 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/nsortcs.tid @@ -0,0 +1,8 @@ +created: 20150123222108000 +modified: 20150123222139000 +tags: [[nsortcs Operator]] [[Operator Examples]] +title: nsortcs Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "10 010 1000 100 +[nsortcs[]]">> +<<.operator-example 2 "10 010 ALPHA beta alpha 1000 100 +[nsortcs[]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/nth.tid b/editions/tw5.com/tiddlers/filters/examples/nth.tid new file mode 100644 index 000000000..2c31ea9f3 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/nth.tid @@ -0,0 +1,10 @@ +created: 20150118134611000 +modified: 20150123222912000 +tags: [[nth Operator]] [[Operator Examples]] +title: nth Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]nth[]]">> +<<.operator-example 2 "[list[Days of the Week]nth[5]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/plugintiddlers.tid b/editions/tw5.com/tiddlers/filters/examples/plugintiddlers.tid new file mode 100644 index 000000000..d8b359604 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/plugintiddlers.tid @@ -0,0 +1,8 @@ +created: 20150123223006000 +modified: 20150123223023000 +tags: [[plugintiddlers Operator]] [[Operator Examples]] +title: plugintiddlers Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[[$:/core]plugintiddlers[]]">> + diff --git a/editions/tw5.com/tiddlers/filters/examples/prefix.tid b/editions/tw5.com/tiddlers/filters/examples/prefix.tid new file mode 100644 index 000000000..742efbd3c --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/prefix.tid @@ -0,0 +1,9 @@ +created: 20150123223129000 +modified: 20150123223321000 +tags: [[prefix Operator]] [[Operator Examples]] +title: prefix Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[tag[task]!prefix[Go]]">> +<<.operator-example 2 "[prefix[$:/languages/]]">> +<<.operator-example 3 "[prefix[$:/]]" "same as `[is[system]]`">> diff --git a/editions/tw5.com/tiddlers/filters/examples/previous.tid b/editions/tw5.com/tiddlers/filters/examples/previous.tid new file mode 100644 index 000000000..2049512fd --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/previous.tid @@ -0,0 +1,11 @@ +created: 20150123221711000 +modified: 20150123223422000 +tags: [[previous Operator]] [[Operator Examples]] +title: previous Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[[Wednesday]previous[Days of the Week]]">> +<<.operator-example 2 "[[Monday]previous[Days of the Week]]">> +<<.operator-example 3 "Tuesday Wednesday Thursday +[previous[Days of the Week]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/regexp.tid b/editions/tw5.com/tiddlers/filters/examples/regexp.tid new file mode 100644 index 000000000..161df8937 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/regexp.tid @@ -0,0 +1,21 @@ +created: 20150123221711000 +modified: 20150123225347000 +tags: [[regexp Operator]] [[Operator Examples]] +title: regexp Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[!is[system]regexp[Wiki]]" "non-system tiddlers with `Wiki` in their title">> +<<.operator-example 2 "[!is[system]regexp[(?i)Wiki]]" "non-system tiddlers with `Wiki` in their title, ignoring case">> +<<.operator-example 3 "[!is[system]regexp[Wiki(?i)]]" "same again">> +<<.operator-example 4 "[regexp[(?i)\.jpe?g$]]" "tiddlers with titles ending in `.jpg` or `.jpeg`, ignoring case">> +<<.operator-example 5 "[regexp:created[^201408]]" "tiddlers created in August 2014">> + +The regular expression `[0-9]{2}` matches two consecutive digits. Because it contains square brackets, the way to use it with the <<.op regexp>> operator is via a [[variable|Variables]], as follows: + +<$macrocall +$name="wikitext-example-without-html" +src="""<$set name="digit-pattern" value="[0-9]{2}"> +<]">> +"""/> diff --git a/editions/tw5.com/tiddlers/filters/examples/removeprefix.tid b/editions/tw5.com/tiddlers/filters/examples/removeprefix.tid new file mode 100644 index 000000000..99026a4bc --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/removeprefix.tid @@ -0,0 +1,7 @@ +created: 20150118132851000 +modified: 20150123210429000 +tags: [[removeprefix Operator]] [[Operator Examples]] +title: removeprefix Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[[My Cat]] [[Your Garden]] [[My Favourite Armchair]] +[removeprefix[My ]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/removesuffix.tid b/editions/tw5.com/tiddlers/filters/examples/removesuffix.tid new file mode 100644 index 000000000..63546f2a0 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/removesuffix.tid @@ -0,0 +1,9 @@ +created: 20150118132851000 +modified: 20150123211000000 +tags: [[removesuffix Operator]] [[Operator Examples]] +title: removesuffix Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "SIMPLEX Googolplex Complex +[removesuffix[plex]]">> + + diff --git a/editions/tw5.com/tiddlers/filters/examples/rest.tid b/editions/tw5.com/tiddlers/filters/examples/rest.tid new file mode 100644 index 000000000..61b35b119 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/rest.tid @@ -0,0 +1,11 @@ +created: 20150118134611000 +modified: 20150123211722000 +tags: [[rest Operator]] [[Operator Examples]] +title: rest Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]rest[]]">> +<<.operator-example 2 "[list[Days of the Week]rest[3]]">> +<<.operator-example 3 "Z Y X W V U T S R Q P O +[rest[5]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/reverse.tid b/editions/tw5.com/tiddlers/filters/examples/reverse.tid new file mode 100644 index 000000000..960592de2 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/reverse.tid @@ -0,0 +1,9 @@ +created: 20150118134611000 +modified: 20150123212752000 +tags: [[reverse Operator]] [[Operator Examples]] +title: reverse Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]reverse[]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/sameday.tid b/editions/tw5.com/tiddlers/filters/examples/sameday.tid new file mode 100644 index 000000000..7b27bb4d8 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/sameday.tid @@ -0,0 +1,8 @@ +created: 20150124101702000 +modified: 20150124101739000 +tags: [[sameday Operator]] [[Operator Examples]] +title: sameday Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[sameday[20140410]]" "tiddlers modified on 10 April 2014">> +<<.operator-example 2 "[sameday:created[20140410]]" "tiddlers created on 10 April 2014">> diff --git a/editions/tw5.com/tiddlers/filters/examples/search.tid b/editions/tw5.com/tiddlers/filters/examples/search.tid new file mode 100644 index 000000000..233b30d3f --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/search.tid @@ -0,0 +1,10 @@ +created: 20150124104508000 +modified: 20150124110256000 +tags: [[search Operator]] [[Operator Examples]] +title: search Operator (Examples) +type: text/vnd.tiddlywiki + +<$macrocall $name=".operator-example" n="1" eg="[!is[system]search[table]]" ie="non-system tiddlers containing the word <<.word table>>"/> +<$macrocall $name=".operator-example" n="2" eg="[all[shadows]search[table]]" ie="shadow tiddlers containing the word <<.word table>>"/> +<$macrocall $name=".operator-example" n="3" eg="[search:caption[arch]]" ie="tiddlers containing `arch` in their <<.field caption>> field"/> + diff --git a/editions/tw5.com/tiddlers/filters/examples/shadowsource.tid b/editions/tw5.com/tiddlers/filters/examples/shadowsource.tid new file mode 100644 index 000000000..1be4f2fff --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/shadowsource.tid @@ -0,0 +1,8 @@ +created: 20150124111726000 +modified: 20150124210736000 +tags: [[shadowsource Operator]] [[Operator Examples]] +title: shadowsource Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[[$:/core/copyright.txt]shadowsource[]]">> +<<.operator-example 2 "$:/core/copyright.txt $:/plugins/tiddlywiki/railroad/parser.js +[shadowsource[]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/sort.tid b/editions/tw5.com/tiddlers/filters/examples/sort.tid new file mode 100644 index 000000000..e6edf8ecf --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/sort.tid @@ -0,0 +1,13 @@ +created: 20150124112340000 +modified: 20150124113250000 +tags: [[sort Operator]] [[Operator Examples]] +title: sort Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]sort[]]">> +<<.operator-example 2 "[list[Days of the Week]!sort[]]">> +<<.operator-example 3 "one two Three four +[sort[]]">> +<<.operator-example 4 "[prefix[Tiddl]sort[text]]">> +<<.operator-example 5 "[has[created]sort[created]limit[10]]" "the oldest 10 tiddlers in the wiki">> diff --git a/editions/tw5.com/tiddlers/filters/examples/sortcs.tid b/editions/tw5.com/tiddlers/filters/examples/sortcs.tid new file mode 100644 index 000000000..1b5722719 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/sortcs.tid @@ -0,0 +1,10 @@ +created: 20150124113044000 +modified: 20150124113344000 +tags: [[sortcs Operator]] [[Operator Examples]] +title: sortcs Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "one two Three four +[sortcs[]]">> +<<.operator-example 2 "one two Three four +[!sortcs[]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/suffix.tid b/editions/tw5.com/tiddlers/filters/examples/suffix.tid new file mode 100644 index 000000000..869fc1304 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/suffix.tid @@ -0,0 +1,8 @@ +created: 20150124113652000 +modified: 20150124113925000 +tags: [[suffix Operator]] [[Operator Examples]] +title: suffix Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[suffix[.jpg]]">> +<<.operator-example 2 "[tag[task]!suffix[ing]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/tag - Copy.tid b/editions/tw5.com/tiddlers/filters/examples/tag - Copy.tid new file mode 100644 index 000000000..ea9fd1049 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/tag - Copy.tid @@ -0,0 +1,9 @@ +created: 20150124142346000 +modified: 20150124142713000 +tags: [[untagged Operator]] [[Operator Examples]] +title: untagged Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[untagged[]]">> +<<.operator-example 2 "[all[shadows]untagged[]]">> +<<.operator-example 3 "[list[HelloThere]!untagged[]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/tag.tid b/editions/tw5.com/tiddlers/filters/examples/tag.tid new file mode 100644 index 000000000..587442fed --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/tag.tid @@ -0,0 +1,10 @@ +created: 20150124122400000 +modified: 20150124122939000 +tags: [[tag Operator]] [[Operator Examples]] +title: tag Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[tag[task]]">> +<<.operator-example 2 "[tag[task]!tag[done]]">> +<<.operator-example 3 "[!tag[task]]">> +<<.operator-example 4 "[all[shadows]tag[$:/tags/Stylesheet]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/tagging.tid b/editions/tw5.com/tiddlers/filters/examples/tagging.tid new file mode 100644 index 000000000..6efe2f555 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/tagging.tid @@ -0,0 +1,9 @@ +created: 20150124133043000 +modified: 20150124133617000 +tags: [[tagging Operator]] [[Operator Examples]] +title: tagging Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[[task]tagging[]]" "same as `[tag[task]]`">> +<<.operator-example 2 "Concepts task +[tagging[]]">> +<<.operator-example 3 "[all[current]tagging[]]" "tiddlers tagged with the current one">> diff --git a/editions/tw5.com/tiddlers/filters/examples/tags.tid b/editions/tw5.com/tiddlers/filters/examples/tags.tid new file mode 100644 index 000000000..6a84f23e3 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/tags.tid @@ -0,0 +1,9 @@ +created: 20150124134009000 +modified: 20150124134203000 +tags: [[tags Operator]] [[Operator Examples]] +title: tags Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[[Filter Operators]tags[]]">> +<<.operator-example 2 "[all[shadows]tags[]]">> +<<.operator-example 3 "[all[shadows+tiddlers]tags[]sort[]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/title.tid b/editions/tw5.com/tiddlers/filters/examples/title.tid new file mode 100644 index 000000000..c59b26fe3 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/title.tid @@ -0,0 +1,15 @@ +created: 20150124140124000 +modified: 20150124140355000 +tags: [[title Operator]] [[Operator Examples]] +title: title Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[title[HelloThere]]">> +<<.operator-example 2 "[[HelloThere]]">> +<<.operator-example 3 "HelloThere">> +<<.operator-example 4 "[title[HelloThere]] [title[Filter Operators]]">> +<<.operator-example 5 "[[HelloThere]] [[Filter Operators]]">> +<<.operator-example 6 "HelloThere [[Filter Operators]]">> +<<.operator-example 7 "[tag[Filters]] +[!title[Filter Operators]]">> +<<.operator-example 8 "[tag[Filters]] +[![Filter Operators]]">> +<<.operator-example 9 "[tag[Filters]] -[[Filter Operators]]">> diff --git a/editions/tw5.com/tiddlers/filters/field.tid b/editions/tw5.com/tiddlers/filters/field.tid index 215048838..f25348c4e 100644 --- a/editions/tw5.com/tiddlers/filters/field.tid +++ b/editions/tw5.com/tiddlers/filters/field.tid @@ -1,28 +1,26 @@ created: 20140410103123179 -modified: 20150119192437000 -tags: [[Filter Operators]] [[Common Operators]] [[Field Operators]] +modified: 20150124201655000 +tags: [[Filter Operators]] [[Common Operators]] [[Field Operators]] [[Negatable Operators]] title: field Operator type: text/vnd.tiddlywiki caption: field -purpose: filter the input tiddlers by field value +purpose: filter the input by field -<$macrocall $name=".operator-def-suffix" -input="a [[title selection|Title Selections]]" -suffix="the name of a field" +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +suffix="the name of a [[field|TiddlerFields]]" suffixName="f" -parameter="a potential value for field <<.place f>>" -paramName="p" -output="the [[subselection|Title Selections]] of the input tiddlers in which field <<.place f>> has the value <<.place p>>" +parameter="a possible value of field <<.place f>>" +paramName="s" +output="those input tiddlers in which field <<.place f>> has the value <<.place s>>" +negationOutput="those input tiddlers in which field <<.place f>> does <<.em not>> have the value <<.place s>>" /> -If <<.place p>> is empty, <<.op field>> will match both of the following: +If <<.place s>> is empty, <<.op field>> will match both of the following: * tiddlers that don't contain field <<.place f>> * tiddlers in which field <<.place f>> exists but has an empty value -;Negation -: `!field` outputs the subselection of the input tiddlers in which field <<.place f>> does <<.em not>> have the value <<.place p>>. - -The [[Filter Syntax]] treats any unrecognised [[filter operator|Filter Operators]] as if it was the suffix to the <<.olink field>> operator. See the second example below. +The syntax of a [[filter step|Filter Step]] treats any unrecognised [[filter operator|Filter Operators]] as if it was the suffix to the <<.op field>> operator. See the <<.operator-examples "field" "examples">>. <<.operator-examples "field">> diff --git a/editions/tw5.com/tiddlers/filters/fields.tid b/editions/tw5.com/tiddlers/filters/fields.tid index 9f037fd86..f73f2b7a9 100644 --- a/editions/tw5.com/tiddlers/filters/fields.tid +++ b/editions/tw5.com/tiddlers/filters/fields.tid @@ -1,15 +1,15 @@ created: 20140924115616653 -modified: 20150119192440000 +modified: 20150124184835000 tags: [[Filter Operators]] [[Field Operators]] title: fields Operator type: text/vnd.tiddlywiki caption: fields -purpose: get all fields of the input tiddlers +purpose: select all field names of the input titles <$macrocall $name=".operator-def" -input="a [[selection|Title Selections]] of tiddler titles" +input="a [[selection of titles|Title Selection]]" parameter="none" -output="the [[selection|Title Selections]] of all field names contained in the input tiddlers" +output="all the field names contained in the input tiddlers" /> Each input title is processed in turn. Its list of field names is retrieved (in no particular order) and then [[dominantly appended|Dominant Append]] to the operator's output. diff --git a/editions/tw5.com/tiddlers/filters/first.tid b/editions/tw5.com/tiddlers/filters/first.tid index 45011e60e..b7302cfd1 100644 --- a/editions/tw5.com/tiddlers/filters/first.tid +++ b/editions/tw5.com/tiddlers/filters/first.tid @@ -1,16 +1,16 @@ created: 20140410103123179 -modified: 20150119192443000 -tags: [[Filter Operators]] [[List Operators]] +modified: 20150124161800000 +tags: [[Filter Operators]] [[Order Operators]] title: first Operator type: text/vnd.tiddlywiki caption: first -purpose: get the first <<.place n>> input titles +purpose: select the first <<.place n>> input titles <$macrocall $name=".operator-def" -input="a [[selection|Title Selections]] of titles" +input="a [[selection of titles|Title Selection]]" parameter="an integer, defaulting to 1" paramName="n" -output="the first <<.place n>> titles from the input" +output="the first <<.place n>> input titles" /> <<.operator-examples "first">> diff --git a/editions/tw5.com/tiddlers/filters/get.tid b/editions/tw5.com/tiddlers/filters/get.tid index d89ad6d37..1f9980ae9 100644 --- a/editions/tw5.com/tiddlers/filters/get.tid +++ b/editions/tw5.com/tiddlers/filters/get.tid @@ -1,20 +1,20 @@ created: 20140426183123179 -modified: 20150119192446000 +modified: 20150124165013000 tags: [[Filter Operators]] [[Field Operators]] title: get Operator type: text/vnd.tiddlywiki caption: get -purpose: get the values of a field from all input tiddlers +purpose: select all values of a field in the input titles <$macrocall $name=".operator-def" -input="a [[selection|Title Selections]] of tiddler titles" +input="a [[selection of titles|Title Selection]]" parameter="the name of a [[field|TiddlerFields]]" paramName="f" -output="the values of field <<.place f>> in each of the input tiddlers" +output="the values of field <<.place f>> in each of the input titles" /> -Each input tiddler is processed in turn. If the tiddler contains field <<.place f>>, and the value of this field is not empty, then its value is appended to the output. +Each input title is processed in turn. If the corresponding tiddler contains field <<.place f>>, and the value of this field is not empty, then its value is appended to the output. -Unlike most other [[Filter Operators]], the output of <<.op get>> can contain duplicates. +Unlike most other [[Filter Operators]], the [[selection|Title Selection]] output by <<.op get>> can contain duplicates. To avoid duplicates, use `each[f]get[f]`. <<.operator-examples "get">> diff --git a/editions/tw5.com/tiddlers/filters/has.tid b/editions/tw5.com/tiddlers/filters/has.tid index ed13e935e..db20f1aab 100644 --- a/editions/tw5.com/tiddlers/filters/has.tid +++ b/editions/tw5.com/tiddlers/filters/has.tid @@ -1,25 +1,18 @@ created: 20140410103123179 -modified: 20150119192449000 -tags: [[Filter Operators]] [[Common Operators]] [[Field Operators]] +modified: 20150124191952000 +tags: [[Filter Operators]] [[Common Operators]] [[Field Operators]] [[Negatable Operators]] title: has Operator type: text/vnd.tiddlywiki caption: has -purpose: filter the input tiddlers by field existence +purpose: filter the input by field existence <$macrocall $name=".operator-def" syntax="has[f]" -input="a [[selection|Title Selections]] of tiddler titles" -parameter="the name of a field" +input="a [[selection of titles|Title Selection]]" +parameter="the name of a [[field|TiddlerFields]]" paramName="f" -output="the [[subselection|Title Selections]] of the input tiddlers that have a value in field <<.place f>>" +output="those input tiddlers in which field <<.place f>> has a non-empty value" +negationOutput="those input tiddlers in which field <<.place f>> does <<.em not>> exist or has an empty value" /> -<<.op has>> filters out both of the following: - -* tiddlers that don't contain field <<.place f>> -* tiddlers in which field <<.place f>> exists but has an empty value - -;Negation -: `!has` outputs the subset of the input tiddlers in which field <<.place f>> does <<.em not>> exist or does not have the value <<.place p>>. - <<.operator-examples "has">> diff --git a/editions/tw5.com/tiddlers/filters/indexes.tid b/editions/tw5.com/tiddlers/filters/indexes.tid index 105974d41..0d79aeb9a 100644 --- a/editions/tw5.com/tiddlers/filters/indexes.tid +++ b/editions/tw5.com/tiddlers/filters/indexes.tid @@ -1,19 +1,19 @@ created: 20140410103123179 -modified: 20150119192453000 +modified: 20150124184840000 tags: [[Filter Operators]] title: indexes Operator type: text/vnd.tiddlywiki caption: indexes -purpose: get all properties of the input data tiddlers +purpose: select all data properties of the input titles <$macrocall $name=".operator-def" -input="a [[selection|Title Selections]] of tiddler titles" +input="a [[selection of titles|Title Selection]]" parameter="none" -output="the [[selection|Title Selections]] of all property names contained in the input data tiddlers" +output="all the property names or indices contained in the input data tiddlers" /> Each input title is processed in turn, and is ignored if it does not denote a [[data tiddler|DataTiddlers]]. The list of property names is retrieved from the data tiddler (in no particular order) and then [[dominantly appended|Dominant Append]] to the operator's output. -Where a tiddler's [[content is JSON|JSONTiddlers]] with an array as its root, the <<.op indexes>> operator retrieves a selection of integer indexes instead. +Where a tiddler's [[content is JSON|JSONTiddlers]] with an array as its root, the <<.op indexes>> operator retrieves a selection of integer indices instead. <<.operator-examples "indexes">> diff --git a/editions/tw5.com/tiddlers/filters/is.tid b/editions/tw5.com/tiddlers/filters/is.tid index 5269acf04..dc8841ab3 100644 --- a/editions/tw5.com/tiddlers/filters/is.tid +++ b/editions/tw5.com/tiddlers/filters/is.tid @@ -1,37 +1,37 @@ created: 20140410103123179 -modified: 20150119192457000 -tags: [[Filter Operators]] [[Common Operators]] [[Category Operators]] +modified: 20150124202225000 +tags: [[Filter Operators]] [[Common Operators]] [[Negatable Operators]] title: is Operator type: text/vnd.tiddlywiki caption: is -purpose: filter the input tiddlers by basic category +purpose: filter the input by fundamental category <$macrocall $name=".operator-def" -input="a [[selection|Title Selections]] of titles" -parameter="see below" -paramName="p" -output="the [[subselection|Title Selections]] of the input tiddlers that belong to the specified basic category" +input="a [[selection of titles|Title Selection]]" +parameter="a category -- see below" +paramName="c" +output="those input tiddlers that belong to category <<.place c>>" +negationOutput="those input tiddlers that do <<.em not>> belong to category <<.place c>>" /> -The parameter is one of the following categories: +The parameter <<.place c>> is one of the following fundamental categories: |!Category |!Matches any tiddler that... | -|^`current`|is the [[current tiddler|CurrentTiddler]] | -|^`image`|has an image ContentType | +|^`current` |is the [[current tiddler|CurrentTiddler]] | +|^`image` |has an image ContentType | |^`missing` |does not exist (other than possibly as a non-shadow tiddler), regardless of whether there are any links it | -|^`orphan` |has no [[Observable Links]] to it | +|^`orphan` |has no [[hard links|Hard and Soft Links]] to it | |^`shadow` |is a [[shadow tiddler|ShadowTiddlers]], regardless of whether it has been overridden with a non-shadow tiddler | |^`system` |is a [[system tiddler|SystemTiddlers]], i.e. its title starts with `$:/` | |^`tag` |is in use as a tag | |^`tiddler` |exists as a non-shadow tiddler | -;Negation -: `!is` outputs the subselection of the input tiddlers that are <<.em not>> in the specified category. `!is[tiddler]` is a synonym for `is[missing]`, and vice versa. +If <<.place c>> is anything else, the output is an error message. -An unrecognised category outputs an error string. +`!is[tiddler]` is a synonym for `is[missing]`, and vice versa. -When <<.op is[missing]>> is the first operator in a [[run|Filter Syntax]], its output is always empty. And when <<.op is[shadow]>> comes first, it outputs only those shadow tiddlers that have been overridden. This is because the [[initial input to a run|Filter Syntax]] contains only <<.em non>>-shadow tiddlers. +When <<.op is[missing]>> is the first operator in a [[run|Filter Run]], its output is always empty. And when <<.op is[shadow]>> comes first, it outputs only those shadow tiddlers that have been overridden. This is because the [[initial input to a run|Filter Expression]] contains only <<.em non>>-shadow tiddlers. -The <<.op all>> operator is similar, but its scope is the whole wiki. +The <<.olink all>> operator is similar, but its scope is the whole wiki. <<.operator-examples "is">> diff --git a/editions/tw5.com/tiddlers/filters/last.tid b/editions/tw5.com/tiddlers/filters/last.tid index 0a993eb9d..360fe175b 100644 --- a/editions/tw5.com/tiddlers/filters/last.tid +++ b/editions/tw5.com/tiddlers/filters/last.tid @@ -1,16 +1,16 @@ created: 20140410103123179 -modified: 20150119192502000 -tags: [[Filter Operators]] [[List Operators]] +modified: 20150124204508000 +tags: [[Filter Operators]] [[Order Operators]] title: last Operator type: text/vnd.tiddlywiki caption: last -purpose: get the last <<.place n>> input titles +purpose: select the last <<.place n>> input titles <$macrocall $name=".operator-def" -input="a [[selection|Title Selections]] of titles" +input="a [[selection of titles|Title Selection]]" parameter="an integer, defaulting to 1" paramName="n" -output="the last <<.place n>> titles from the input" +output="the last <<.place n>> input titles" /> <<.operator-examples "last">> diff --git a/editions/tw5.com/tiddlers/filters/limit.tid b/editions/tw5.com/tiddlers/filters/limit.tid index 96bc6bb9a..c4b9dac3b 100644 --- a/editions/tw5.com/tiddlers/filters/limit.tid +++ b/editions/tw5.com/tiddlers/filters/limit.tid @@ -1,15 +1,19 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters CommonFilters -caption: limit -title: FilterOperator: limit +modified: 20150124204544000 +tags: [[Filter Operators]] [[Common Operators]] [[Order Operators]] [[Negatable Operators]] +title: limit Operator type: text/vnd.tiddlywiki +caption: limit +purpose: select the first or last <<.place n>> input titles -The ''limit'' filter operator trims the current list to the length specified in the operator. Usually the first tiddlers in the list are returned; preceding the operator with ''!'' causes it to instead return the last tiddlers in the list. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="an integer, defaulting to 0" +paramName="n" +output="the first <<.place n>> input titles" +negationOutput="the last <<.place n>> input titles" +/> -For example: - -|!Filter String |!Description | -|`[sort[modified]!limit[20]]` |Returns the titles of the last 20 tiddlers to have been modified | -|`[has[created]sort[created]limit[10]]` |Returns the titles of the oldest 10 tiddlers to have been created | +`limit[n]` and `!limit[n]` are synonyms for `first[n]` and `last[n]` respectively. +<<.operator-examples "limit">> diff --git a/editions/tw5.com/tiddlers/filters/links.tid b/editions/tw5.com/tiddlers/filters/links.tid index 5302e270a..ca93cf1a8 100644 --- a/editions/tw5.com/tiddlers/filters/links.tid +++ b/editions/tw5.com/tiddlers/filters/links.tid @@ -1,14 +1,17 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters CommonFilters -caption: links -title: FilterOperator: links +modified: 20150124184844000 +tags: [[Filter Operators]] [[Common Operators]] +title: links Operator type: text/vnd.tiddlywiki +caption: links +purpose: find the titles linked to by each input title -The ''links'' filter operator replaces the current list with a list of the targets of outgoing links from those tiddlers. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="none" +output="the titles to which the input tiddlers contain [[hard links|Hard and Soft Links]]" +/> -For example: +Each input title is processed in turn. The corresponding tiddler's list of links is generated, in the order in which they appear in the tiddler's text, and [[dominantly appended|Dominant Append]] to the operator's overall output. -|!Filter String |!Description | -|`[[HelloThere]links[]]` |Returns the titles of tiddlers linked from `HelloThere` | -|`[all[current]links[]]` |Returns the titles of tiddlers linked from the current tiddler | +<<.operator-examples "links">> diff --git a/editions/tw5.com/tiddlers/filters/list.tid b/editions/tw5.com/tiddlers/filters/list.tid index c546a3e40..fcdb7581e 100644 --- a/editions/tw5.com/tiddlers/filters/list.tid +++ b/editions/tw5.com/tiddlers/filters/list.tid @@ -1,16 +1,23 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: list -title: FilterOperator: list +modified: 20150124203324000 +tags: [[Filter Operators]] [[Field Operators]] [[Absolute Operators]] [[Negatable Operators]] +title: list Operator type: text/vnd.tiddlywiki +caption: list +purpose: select titles via a list field -The ''list'' filter operator replaces the current list with the list contained in the TextReference specified in the operand. The default field for the text reference is `list`. +<$macrocall $name=".operator-def" +input="ignored" +negationInput="a [[selection of titles|Title Selection]]" +parameter="a [[reference|TextReference]] to a [[field|TiddlerFields]] or [[property|DataTiddlers]] of a particular tiddler" +paramName="r" +output="the titles stored as a [[title list|Title List]] at <<.place r>>" +negationOutput="those input titles that are <<.em not>> mentioned at <<.place r>>" +/> -Preceding the operator name with `!` inverts the logic so that the filter only returns the tiddlers in the current list that are not listed in the specified list. +<<.place r>> can reference either a field or a property. See [[TextReference]] for the syntax. -For example: +* If neither is specified, the <<.field list>> field is used by default. So `[list[T]]` outputs the titles listed in the <<.field list>> of tiddler T. +* If <<.place r>> consists of <<.em only>> a field or a property, the tiddler part of the reference defaults to the CurrentTiddler. So `[list[!!tags]]` outputs the titles listed in the <<.field tags>> field of the current tiddler. -|!Filter String |!Description | -|`[list[HelloThere]]` |Returns the list of tiddlers in the `list` field of the tiddler `HelloThere` | -|`[list[HelloThere!!mylist]]` |Returns the list of tiddlers in the `mylist` field of the tiddler `HelloThere` | +<<.operator-examples "list">> diff --git a/editions/tw5.com/tiddlers/filters/listed.tid b/editions/tw5.com/tiddlers/filters/listed.tid index b008e317d..b5095f8d1 100644 --- a/editions/tw5.com/tiddlers/filters/listed.tid +++ b/editions/tw5.com/tiddlers/filters/listed.tid @@ -1,14 +1,20 @@ created: 20140410103123179 -modified: 20140613103123179 -tags: Filters -caption: listed -title: FilterOperator: listed +modified: 20150124203638000 +tags: [[Filter Operators]] [[Field Operators]] +title: listed Operator type: text/vnd.tiddlywiki +caption: listed +purpose: find the titles that list the input titles -The ''listed'' filter operator returns the titles of the tiddlers that have `list` fields that contain any members of the current list. The optional operand can be used to specify a different field. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="the name of a [[field|TiddlerFields]], defaulting to <<.field list>>" +paramName="f" +output="the titles in which field <<.place f>> mentions any of the input titles" +/> -For example: +<<.field f>> is assumed to be a [[title list|Title List]]. -|!Filter String |!Description | -|`[[HelloThere]listed[]]` |Returns the titles of any tiddlers containing `HelloThere` in their `list` fields | -|`[all[current]listed[my-special-list]]` |Returns the titles of any tiddlers containing the current tiddler in their `my-special-list` fields | +Each input title is processed in turn. A list of tiddlers whose <<.place f>> field mentions it is generated (in no particular order) and [[dominantly appended|Dominant Append]] to the operator's overall output. + +<<.operator-examples "listed">> diff --git a/editions/tw5.com/tiddlers/filters/modules.tid b/editions/tw5.com/tiddlers/filters/modules.tid index a54d1b2c0..a3e525837 100644 --- a/editions/tw5.com/tiddlers/filters/modules.tid +++ b/editions/tw5.com/tiddlers/filters/modules.tid @@ -1,15 +1,15 @@ created: 20140410103123179 -modified: 20150118182943000 -tags: Filters -caption: modules -title: FilterOperator: modules +modified: 20150124170624000 +tags: [[Filter Operators]] [[Special Operators]] +title: modules Operator type: text/vnd.tiddlywiki +caption: modules +purpose: select the names of all modules of the input module types -The ''modules'' filter operator treats the current list as a list of [[module types|ModuleType]], and returns the titles of all of the modules of those types. +<$macrocall $name=".operator-def" +input="a [[selection|Title Selection]] of module types" +parameter="none" +output="the title of each module with any of the input types" +/> -For example: - -|!Filter String |!Description | -|`[[filteroperator]modules[]]` |Returns a list of the modules of type `filteroperator` | - -See also [[FilterOperator: moduletypes]]. +<<.operator-examples "modules">> diff --git a/editions/tw5.com/tiddlers/filters/moduletypes.tid b/editions/tw5.com/tiddlers/filters/moduletypes.tid index 1919c5591..d47d1580d 100644 --- a/editions/tw5.com/tiddlers/filters/moduletypes.tid +++ b/editions/tw5.com/tiddlers/filters/moduletypes.tid @@ -1,15 +1,15 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: moduletypes -title: FilterOperator: moduletypes +modified: 20150124170640000 +tags: [[Filter Operators]] [[Special Operators]] [[Absolute Operators]] +title: moduletypes Operator type: text/vnd.tiddlywiki +caption: moduletypes +purpose: select the names of all ~TiddlyWiki module types -The ''moduletypes'' filter operator replaces the current list with a list of the types of the currently loaded modules. +<$macrocall $name=".operator-def" +input="ignored" +parameter="none" +output="the name of each known ~TiddlyWiki [[module type|ModuleType]], in alphabetical order" +/> -For example: - -|!Filter String |!Description | -|`[moduletypes[]]` |Returns a list of the types of the currently loaded modules | - -See also [[FilterOperator: modules]]. +<<.operator-examples "moduletypes">> diff --git a/editions/tw5.com/tiddlers/filters/next.tid b/editions/tw5.com/tiddlers/filters/next.tid index 4d8e51b9b..9e3415d41 100644 --- a/editions/tw5.com/tiddlers/filters/next.tid +++ b/editions/tw5.com/tiddlers/filters/next.tid @@ -1,21 +1,18 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: next -title: FilterOperator: next +modified: 20150124171754000 +tags: [[Filter Operators]] [[Field Operators]] [[Order Operators]] +title: next Operator type: text/vnd.tiddlywiki +caption: next +purpose: find which titles in a <<.field list>> field follow the input ones -The ''next'' filter operator takes each tiddler in the current list and looks it up in the `list` field of the tiddler specified in the operand, and then returns the immediately following tiddler title. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="a tiddler title" +paramName="t" +output="a selection containing each title that immediately follows each of the input titles in the <<.field list>> field of <<.place t>>" +/> -The following examples assume a tiddler called `MyList` with a `list` field containing: +Each input title is processed in turn, and its successor is located in the <<.field list>> field and appended to the output. If a title is not listed in the field, or is the last title there, then it contributes nothing to the output. -``` -one two three four five -``` - -|!Filter String |!Description | -|`[[three]next[MyList]]` |Returns `four` | -|`[[five]next[MyList]]` |Returns an empty list | -|`one three +[next[MyList]]` |Returns `two`, `four` | - -See also [[FilterOperator: previous]]. +<<.operator-examples "next">> diff --git a/editions/tw5.com/tiddlers/filters/nsort.tid b/editions/tw5.com/tiddlers/filters/nsort.tid index 3c6682c11..7bd2d78ad 100644 --- a/editions/tw5.com/tiddlers/filters/nsort.tid +++ b/editions/tw5.com/tiddlers/filters/nsort.tid @@ -1,16 +1,19 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: nsort -title: FilterOperator: nsort +modified: 20150124205344000 +tags: [[Filter Operators]] [[Field Operators]] [[Order Operators]] [[Negatable Operators]] +title: nsort Operator type: text/vnd.tiddlywiki +caption: nsort +purpose: sort the input by number field -The ''nsort'' filter operator sorts the current list as numeric values, along the field specified in the operand (which defaults to `title`). String values are sorted case insensitively (upper and lower case letters are considered equivalent). Preceding the operator with `!` reverses the sort order. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="the name of a [[field|TiddlerFields]], defaulting to <<.field title>>" +paramName="f" +output="the input, sorted into ascending order by field <<.field f>>, treating field values as numbers" +negationOutput="the input, likewise sorted into descending order" +/> -For example: +Non-numeric values are treated as having a higher value than any number, and the difference between capital and lowercase letters is ignored. Compare <<.olink nsortcs>>. -|!Filter String |!Description | -|`10 010 1000 100 +[nsort[]]` |Returns `10`, `010`, `100`, `1000` | -|`10 010 alpha 1000 100 +[nsort[]]` |Returns `10`, `010`, `100`, `1000`, `alpha` | - -See also [[FilterOperator: sort]], [[FilterOperator: sortcs]] and [[FilterOperator: nsortcs]]. +<<.operator-examples "nsort">> diff --git a/editions/tw5.com/tiddlers/filters/nsortcs.tid b/editions/tw5.com/tiddlers/filters/nsortcs.tid index afe5199bc..e546589b2 100644 --- a/editions/tw5.com/tiddlers/filters/nsortcs.tid +++ b/editions/tw5.com/tiddlers/filters/nsortcs.tid @@ -1,16 +1,19 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: nsortcs -title: FilterOperator: nsortcs +modified: 20150124205339000 +tags: [[Filter Operators]] [[Field Operators]] [[Order Operators]] [[Negatable Operators]] +title: nsortcs Operator type: text/vnd.tiddlywiki +caption: nsortcs +purpose: sort the input titles by number field, ignoring case -The ''nsortcs'' filter operator sorts the current list as numeric values, along the field specified in the operand (which defaults to `title`). String values are sorted case sensitively (upper and lower case letters are considered different). Preceding the operator with `!` reverses the sort order. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="the name of a [[field|TiddlerFields]], defaulting to <<.field title>>" +paramName="f" +output="the input, sorted into ascending order by field <<.field f>>, treating field values as numbers" +negationOutput="the input, likewise sorted into descending order" +/> -For example: +Non-numeric values are treated as having a higher value than any number, and capital and lowercase letters are treated as different. Compare <<.olink nsort>>. -|!Filter String |!Description | -|`10 010 1000 100 +[nsortcs[]]` |Returns `10`, `010`, `100`, `1000` | -|`10 010 alpha 1000 100 +[nsortcs[]]` |Returns `10`, `010`, `100`, `1000`, `alpha` | - -See also [[FilterOperator: sort]], [[FilterOperator: sortcs]] and [[FilterOperator: nsort]]. +<<.operator-examples "nsortcs">> diff --git a/editions/tw5.com/tiddlers/filters/nth.tid b/editions/tw5.com/tiddlers/filters/nth.tid index 35438d3d6..ed8058b0d 100644 --- a/editions/tw5.com/tiddlers/filters/nth.tid +++ b/editions/tw5.com/tiddlers/filters/nth.tid @@ -1,14 +1,18 @@ -created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: nth -title: FilterOperator: nth +created: 20150122204111000 +modified: 20150124204959000 +tags: [[Filter Operators]] [[Order Operators]] +title: nth Operator type: text/vnd.tiddlywiki +caption: nth +purpose: select the <<.place n>>th input title -Without an operand, the ''nth'' filter operator returns the first entry in the current list. The optional operand specifies the position of the entry in the list. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="an integer, defaulting to 1" +paramName="n" +output="the <<.place n>>th input title" +/> -For example: +<<.place n>> is one-based. In other words, `nth[1]` has the same effect as the <<.olink first>> operator. -|!Filter String |!Description | -|`one two three four five +[nth[]]` |Returns `one` | -|`one two three four five +[nth[3]]` |Returns `three` | +<<.operator-examples "nth">> diff --git a/editions/tw5.com/tiddlers/filters/plugintiddlers.tid b/editions/tw5.com/tiddlers/filters/plugintiddlers.tid index 378251fe3..95b4dfab6 100644 --- a/editions/tw5.com/tiddlers/filters/plugintiddlers.tid +++ b/editions/tw5.com/tiddlers/filters/plugintiddlers.tid @@ -1,15 +1,15 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: plugintiddlers -title: FilterOperator: plugintiddlers +modified: 20150124200549000 +tags: [[Filter Operators]] [[Special Operators]] +title: plugintiddlers Operator type: text/vnd.tiddlywiki +caption: plugintiddlers +purpose: select all shadow titles in the input plugins -The ''plugintiddlers'' filter operator returns the titles of the shadow tiddlers within any plugin tiddlers in the current list. +<$macrocall $name=".operator-def" +input="a [[selection|Title Selection]] of plugin tiddler titles" +parameter="none" +output="all shadow titles contained in the input plugins" +/> -For example: - -|!Filter String |!Description | -|`[[$:/core]plugintiddlers[]]` |Returns a list of the shadow tiddlers within the [[$:/core]] module | - -See also [[FilterOperator: shadowsource]]. +<<.operator-examples "plugintiddlers">> diff --git a/editions/tw5.com/tiddlers/filters/prefix.tid b/editions/tw5.com/tiddlers/filters/prefix.tid index af965c7c6..bb4e3a908 100644 --- a/editions/tw5.com/tiddlers/filters/prefix.tid +++ b/editions/tw5.com/tiddlers/filters/prefix.tid @@ -1,16 +1,19 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: prefix -title: FilterOperator: prefix +modified: 20150124192023000 +tags: [[Filter Operators]] [[String Operators]] [[Negatable Operators]] +title: prefix Operator type: text/vnd.tiddlywiki +caption: prefix +purpose: filter the input titles by how they start -The ''prefix'' filter operator returns the titles in the current list that start with a specified prefix. If the ''prefix'' operator is preceded by `!` then it returns the titles that do not start with the specified prefix. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="a string of characters" +paramName="s" +output="those input titles that start with <<.place s>>" +negationOutput="those input tiddlers that do <<.em not>> start with <<.place s>>" +/> -For example: +<<.s-matching-is-case-sensitive>> -|!Filter String |!Description | -|`[tag[task]!prefix[hidden]]` |Returns tiddlers tagged `task` whose titles do not start with `hidden` | -|`[prefix[$:/]]` |Equivalent to `[is[system]]` | - -See also [[FilterOperator: removeprefix]], [[FilterOperator: removesuffix]], [[FilterOperator: removesuffix]], [[FilterOperator: addprefix]], and [[FilterOperator: addsuffix]]. +<<.operator-examples "prefix">> diff --git a/editions/tw5.com/tiddlers/filters/previous.tid b/editions/tw5.com/tiddlers/filters/previous.tid index d3f6ef53b..43966dc1a 100644 --- a/editions/tw5.com/tiddlers/filters/previous.tid +++ b/editions/tw5.com/tiddlers/filters/previous.tid @@ -1,21 +1,18 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: previous -title: FilterOperator: previous +modified: 20150124171748000 +tags: [[Filter Operators]] [[Field Operators]] [[Order Operators]] +title: previous Operator type: text/vnd.tiddlywiki +caption: previous +purpose: find which titles in a <<.field list>> field precede the input ones -The ''previous'' filter operator takes each tiddler in the current list and looks it up in the `list` field of the tiddler specified in the operand, and then returns the immediately preceding tiddler title. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="a tiddler title" +paramName="t" +output="a selection containing each title that immediately precedes each of the input titles in the <<.field list>> field of <<.place t>>" +/> -The following examples assume a tiddler called `MyList` with a `list` field containing: +Each input title is processed in turn, and its predecessor is located in the <<.field list>> field and appended to the output. If a title is not listed in the field, or is the first item there, then it contributes nothing to the output. -``` -one two three four five -``` - -|!Filter String |!Description | -|`[[three]previous[MyList]]` |Returns `two` | -|`[[one]previous[MyList]]` |Returns an empty list | -|`two four +[previous[MyList]]` |Returns `one`, `three` | - -See also [[FilterOperator: next]]. +<<.operator-examples "previous">> diff --git a/editions/tw5.com/tiddlers/filters/regexp.tid b/editions/tw5.com/tiddlers/filters/regexp.tid index 36bb1a78c..49d825150 100644 --- a/editions/tw5.com/tiddlers/filters/regexp.tid +++ b/editions/tw5.com/tiddlers/filters/regexp.tid @@ -1,37 +1,31 @@ created: 20140909134102102 -modified: 20140909134102102 -tags: Filters -caption: regexp -title: FilterOperator: regexp +modified: 20150124203736000 +tags: [[Filter Operators]] [[Field Operators]] [[Negatable Operators]] +title: regexp Operator type: text/vnd.tiddlywiki +caption: regexp +purpose: filter the input by pattern-matched field -The ''regexp'' filter operator filters tiddlers that match a regular expression. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +suffix="the name of a [[field|TiddlerFields]]" +suffixName="f" +parameter="a regular expression" +paramName="x" +output="those input tiddlers in which field <<.place f>> matches <<.place x>>" +negationOutput="those input tiddlers in which field <<.place f>> does <<.em not>> match <<.place x>>" +/> -Regular expressions are a way of encoding complex string matching criteria. The format is defined fully in [[this Mozilla reference|https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions]]. +<<.def "Regular expressions">> are concise strings of characters that denote patterns of text to search for. The format used in ~TiddlyWiki is fully defined in [[this Mozilla reference|https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions]]. -The regexp filter operator takes a fieldname as the optional suffix (defaulting to `title`). +The [[filter syntax|Filter Run]] makes it impossible to directly specify a regular expression that contains square brackets. The solution is to store the expression in a [[variable|Variables]]. See the <<.operator-examples "regexp" "examples">>. -The regular expression itself can start or end with an optional string to specify flags in the format `(?flags)` where flags can be "g", "m" or "i". Only the "i" flag is generally useful: it forces the match to be case-insensitive (ie upper and lower case letters are considered the same). +The parameter <<.place x>> can optionally start or end with a string of flags: -For example: +<$railroad text=""" "(?" { ("i"|"m"|:"g") } ")" """/> -|!Filter String |!Description | -|`[all[tiddlers]regexp[EggCup]]` |Selects all tiddlers that have the CamelCase string "EggCup" in their title | -|`[all[tiddlers]regexp[eggcup(?i)]]` |Selects all tiddlers that have the string "eggcup" in their title (ignoring case) | -|`[all[tiddlers]regexp[(?i)\.jpe?g$]]` |Selects all tiddlers with titles ending in ".jpg" or ".jpeg" (ignoring case) | -|`[all[tiddlers]regexp:modified[^2014]]` |Selects all tiddlers whose modified field starts with the string "2014" | +Only the `i` flag is generally useful: it forces the different between capital and lowercase letters to be ignored. -! Regular Expressions with Square Brackets - -Note that the filter syntax doesn't allow you to directly enter regular expressions that include square brackets. Instead, you should use a variable to store the filter string. For example, the following regular expression matches all titles that contain any combination the letters "a", "b" and "c" (with no other characters present). - -``` -<$set name="myfilter" value="^[abc]*$"> -<$list filter="[regexp:title]"> -
-<$view field="title"/> -
- - -``` +If <<.place x>> is empty, <<.op regexp>> will match all of the input tiddlers. +<<.operator-examples "regexp">> diff --git a/editions/tw5.com/tiddlers/filters/removeprefix.tid b/editions/tw5.com/tiddlers/filters/removeprefix.tid index c9ab7b69a..39947c882 100644 --- a/editions/tw5.com/tiddlers/filters/removeprefix.tid +++ b/editions/tw5.com/tiddlers/filters/removeprefix.tid @@ -1,15 +1,18 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: removeprefix -title: FilterOperator: removeprefix +modified: 20150124173431000 +tags: [[Filter Operators]] [[String Operators]] +title: removeprefix Operator type: text/vnd.tiddlywiki +caption: removeprefix +purpose: filter the input titles by how they start, deleting that prefix -The ''removeprefix'' filter operator returns the titles in the current list that start with a specified prefix with the prefix removed. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="a string of characters" +paramName="s" +output="those input titles that start with <<.place s>>, but with those characters discarded" +/> -For example: +<<.s-matching-is-case-sensitive>> -|!Filter String |!Description | -|`tid-one tid-two three +[removeprefix[tid-]]` |Returns `one`, `two` | - -See also [[FilterOperator: prefix]], [[FilterOperator: suffix]], [[FilterOperator: removesuffix]], [[FilterOperator: addprefix]], and [[FilterOperator: addsuffix]]. +<<.operator-examples "removeprefix">> diff --git a/editions/tw5.com/tiddlers/filters/removesuffix.tid b/editions/tw5.com/tiddlers/filters/removesuffix.tid index 9b55a9383..2db32d2ce 100644 --- a/editions/tw5.com/tiddlers/filters/removesuffix.tid +++ b/editions/tw5.com/tiddlers/filters/removesuffix.tid @@ -1,15 +1,18 @@ created: 20140828133830424 -modified: 20140902145613329 -tags: Filters -caption: removesuffix -title: FilterOperator: removesuffix +modified: 20150124173434000 +tags: [[Filter Operators]] [[String Operators]] +title: removesuffix Operator type: text/vnd.tiddlywiki +caption: removesuffix +purpose: filter the input titles by how they end, deleting that suffix -The ''removesuffix'' filter operator returns the titles in the current list that end with a specified suffix with the suffix removed. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="a string of characters" +paramName="s" +output="those input titles that end with <<.place s>>, but with those characters discarded" +/> -For example: +<<.s-matching-is-case-sensitive>> -|!Filter String |!Description | -|`one-tid two-tid three +[removesuffix[-tid]]` |Returns `one`, `two` | - -See also [[FilterOperator: suffix]], [[FilterOperator: prefix]], [[FilterOperator: removeprefix]], [[FilterOperator: addprefix]], and [[FilterOperator: addsuffix]]. +<<.operator-examples "removesuffix">> diff --git a/editions/tw5.com/tiddlers/filters/rest.tid b/editions/tw5.com/tiddlers/filters/rest.tid index cf8e4c675..6242da65a 100644 --- a/editions/tw5.com/tiddlers/filters/rest.tid +++ b/editions/tw5.com/tiddlers/filters/rest.tid @@ -1,14 +1,18 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: rest -title: FilterOperator: rest +modified: 20150124191714000 +tags: [[Filter Operators]] [[Order Operators]] +title: rest Operator type: text/vnd.tiddlywiki +caption: rest +purpose: discard the first <<.place n>> input titles -Without an operand, the ''rest'' filter operator returns all but the first entry in the current list. The optional operand specifies the number of entries to omit. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="an integer, defaulting to 1" +paramName="n" +output="all but the first <<.place n>> input titles" +/> -For example: +<<.olink butfirst>> and <<.olink bf>> are synonyms for <<.op rest>>. -|!Filter String |!Description | -|`one two three four five +[rest[]]` |Returns `two`, `three`, `four`, `five` | -|`one two three four five +[rest[2]]` |Returns `three`, `four`, `five` | +<<.operator-examples "rest">> diff --git a/editions/tw5.com/tiddlers/filters/reverse.tid b/editions/tw5.com/tiddlers/filters/reverse.tid index 7ef56acbd..79ae04c1d 100644 --- a/editions/tw5.com/tiddlers/filters/reverse.tid +++ b/editions/tw5.com/tiddlers/filters/reverse.tid @@ -1,13 +1,15 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: reverse -title: FilterOperator: reverse +modified: 20150124205130000 +tags: [[Filter Operators]] [[Order Operators]] +title: reverse Operator type: text/vnd.tiddlywiki +caption: reverse +purpose: reverse the order of the input titles -The ''reverse'' filter operator reverses the order of the titles in the current list. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="none" +output="the input, in reverse order" +/> -For example: - -|!Filter String |!Description | -|`one two three +[reverse[]]` |Returns the list `three`, `two`, `one` | +<<.operator-examples "reverse">> diff --git a/editions/tw5.com/tiddlers/filters/sameday.tid b/editions/tw5.com/tiddlers/filters/sameday.tid index a9d1dce91..6285288c1 100644 --- a/editions/tw5.com/tiddlers/filters/sameday.tid +++ b/editions/tw5.com/tiddlers/filters/sameday.tid @@ -1,16 +1,22 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -caption: sameday -title: FilterOperator: sameday +modified: 20150124191743000 +tags: [[Filter Operators]] [[Date Operators]] +title: sameday Operator type: text/vnd.tiddlywiki +caption: sameday +purpose: filter the input by date -The ''sameday'' filter operator filters the current list to leave only those tiddlers whose `modified` field is on the same day as the date provided as the operand. The optional suffix allows a different field to be specified. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +suffix="the name of a date [[field|TiddlerFields]], defaulting to <<.field modified>>" +suffixName="f" +parameter="a date, in the [[format|DateFormat]] `YYYYMMDD`" +paramName="d" +output="those input tiddlers in which field <<.place f>> has the value <<.place d>>, ignoring time" +/> -For example: +If <<.place d>> is not a valid date, the output is empty. -|!Filter String |!Description | -|`[sameday[20140410]]` |Returns a list of the tiddlers modified on the 10th April 2014 | -|`[sameday:created[20140410]]` |Returns a list of the tiddlers created on the 10th April 2014 | +<<.place d>> may include a time of day, but this is ignored. -See [[FilterOperator: eachday]] for an example. +<<.operator-examples "sameday">> diff --git a/editions/tw5.com/tiddlers/filters/search.tid b/editions/tw5.com/tiddlers/filters/search.tid index 85910703a..d821dc42c 100644 --- a/editions/tw5.com/tiddlers/filters/search.tid +++ b/editions/tw5.com/tiddlers/filters/search.tid @@ -1,17 +1,24 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters CommonFilters -caption: search -title: FilterOperator: search +modified: 20150124204023000 +tags: [[Filter Operators]] [[Common Operators]] [[Field Operators]] [[Negatable Operators]] +title: search Operator type: text/vnd.tiddlywiki +caption: search +purpose: filter the input by searching tiddler content -The ''search'' filter operator filters the current list to leave only those tiddlers that include the operand text in their title, body or tags. Preceding the operator with `!` returns all tiddlers that do not include the specified text. The search is case-insenstive. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +suffix="optionally, the name of a [[field|TiddlerFields]]" +suffixName="f" +parameter="one or more search terms, separated by spaces" +output="those input tiddlers in which <<.em all>> of the search terms can be found in the value of field <<.place f>>" +negationOutput="those input tiddlers in which <<.em not>> all of the search terms can be so found" +/> -Optionally, a field can be specified to restrict the search. +When used with a suffix, the <<.op search>> operator is similar to <<.olink regexp>> but less powerful. -For example: +If the suffix is omitted, a tiddler is deemed to match if all the search terms appear in the combination of its <<.field tags>>, <<.field text>> and <<.field title>> fields. -|!Filter String |!Description | -|`[search[alsatian]]` |Returns a list of the tiddlers containing the text "alsatian" | -|`[all[shadows]search[alsatian]]` |Returns a list of the shadow tiddlers containing the text "alsatian" | -|`[search:caption[spaniel]]` |Returns a list of the tiddlers containing the text "spaniel" in their caption field | +The search ignores the difference between capital and lowercase letters. + +<<.operator-examples "search">> diff --git a/editions/tw5.com/tiddlers/filters/shadowsource.tid b/editions/tw5.com/tiddlers/filters/shadowsource.tid index a0b7eb7c4..65f54c8c2 100644 --- a/editions/tw5.com/tiddlers/filters/shadowsource.tid +++ b/editions/tw5.com/tiddlers/filters/shadowsource.tid @@ -1,15 +1,17 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -title: FilterOperator: shadowsource -caption: shadowsource +modified: 20150124210534000 +tags: [[Filter Operators]] [[Special Operators]] +title: shadowsource Operator type: text/vnd.tiddlywiki +caption: shadowsource +purpose: select the plugin titles that contain the input shadows -The ''shadowsource'' filter operator returns the titles of the plugin tiddlers containing any ShadowTiddlers in the current list. +<$macrocall $name=".operator-def" +input="a [[selection|Title Selection]] of [[shadow titles|ShadowTiddlers]]" +parameter="none" +output="the [[plugins|Plugins]] that contain the input tiddlers" +/> -For example: +Each input title is processed in turn. If it denotes a shadow tiddler, the title of its plugin tiddler is [[dominantly appended|Dominant Append]] to the output. Non-shadow tiddlers contribute nothing to the output. -|!Filter String |!Description | -|`[[$:/core/copyright.txt]shadowsource[]]` |Returns `$:/core`, which is the plugin that contains the shadow tiddler [[$:/core/copyright.txt]] | - -See also [[FilterOperator: plugintiddlers]]. +<<.operator-examples "shadowsource">> diff --git a/editions/tw5.com/tiddlers/filters/sort.tid b/editions/tw5.com/tiddlers/filters/sort.tid index e00e9ff40..85bc646b8 100644 --- a/editions/tw5.com/tiddlers/filters/sort.tid +++ b/editions/tw5.com/tiddlers/filters/sort.tid @@ -1,18 +1,19 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters CommonFilters -title: FilterOperator: sort -caption: sort +modified: 20150124205350000 +tags: [[Filter Operators]] [[Common Operators]] [[Field Operators]] [[Order Operators]] [[Negatable Operators]] +title: sort Operator type: text/vnd.tiddlywiki +caption: sort +purpose: sort the input by text field -The ''sort'' filter operator sorts the current list case insensitively (upper and lower case letters are considered equivalent), along the field specified in the operand (which defaults to `title`). Preceding the operator with `!` reverses the sort order. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="the name of a [[field|TiddlerFields]], defaulting to <<.field title>>" +paramName="f" +output="the input, sorted into ascending order by field <<.field f>>, treating field values as text" +negationOutput="the input, likewise sorted into descending order" +/> -For example: +The difference between capital and lowercase letters is ignored. Compare <<.olink sortcs>>. -|!Filter String |!Description | -|`one two three four +[sort[]]` |Returns `four`, `one`, `three`, `two` | -|`one two Three four +[sort[]]` |Returns `four`, `one`, `Three`, `two` | - -For an example of use with explicit operands, see [[FilterOperator: limit]]. - -See also [[FilterOperator: nsort]], [[FilterOperator: sortcs]] and [[FilterOperator: nsortcs]]. +<<.operator-examples "sort">> diff --git a/editions/tw5.com/tiddlers/filters/sortcs.tid b/editions/tw5.com/tiddlers/filters/sortcs.tid index 932a0946a..3fb0d369d 100644 --- a/editions/tw5.com/tiddlers/filters/sortcs.tid +++ b/editions/tw5.com/tiddlers/filters/sortcs.tid @@ -1,15 +1,19 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -title: FilterOperator: sortcs -caption: sortcs +modified: 20150124205353000 +tags: [[Filter Operators]] [[Field Operators]] [[Order Operators]] [[Negatable Operators]] +title: sortcs Operator type: text/vnd.tiddlywiki +caption: sortcs +purpose: sort the input by text field, ignoring case -The ''sortcs'' filter operator sorts the current list case sensitively (upper and lower case letters are considered different), along the field specified in the operand (which defaults to `title`). Preceding the operator with `!` reverses the sort order. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="the name of a [[field|TiddlerFields]], defaulting to <<.field title>>" +paramName="f" +output="the input, sorted into ascending order by field <<.field f>>, treating field values as text" +negationOutput="the input, likewise sorted into descending order" +/> -For example: +Capital and lowercase letters are treated as different. Compare <<.olink sort>>. -|!Filter String |!Description | -|`one two Three four +[sortcs[]]` |Returns `Three`, `four`, `one`, `two` | - -See also [[FilterOperator: sort]], [[FilterOperator: nsort]] and [[FilterOperator: nsortcs]]. +<<.operator-examples "sortcs">> diff --git a/editions/tw5.com/tiddlers/filters/suffix.tid b/editions/tw5.com/tiddlers/filters/suffix.tid index 0c12a01a2..a4653b6ce 100644 --- a/editions/tw5.com/tiddlers/filters/suffix.tid +++ b/editions/tw5.com/tiddlers/filters/suffix.tid @@ -1,16 +1,19 @@ created: 20140828133830424 -modified: 20140828133830424 -tags: Filters -title: FilterOperator: suffix -caption: suffix +modified: 20150124192043000 +tags: [[Filter Operators]] [[String Operators]] [[Negatable Operators]] +title: suffix Operator type: text/vnd.tiddlywiki +caption: suffix +purpose: filter the input titles by how they end -The ''suffix'' filter operator returns the titles in the current list that end with a specified suffix. If the ''suffix'' operator is preceded by `!` then it returns the titles that do not end with the specified suffix. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="a string of characters" +paramName="s" +output="those input titles that end with <<.place p>>" +negationOutput="those input tiddlers that do <<.em not>> end with <<.place p>>" +/> -For example: +<<.s-matching-is-case-sensitive>> -|!Filter String |!Description | -|`[tag[task]!suffix[hidden]]` |Returns tiddlers tagged `task` whose titles do not end with `hidden` | -|`[suffix[.jpg]]` |Returns tiddlers whose titles end with `.jpg` | - -See also [[FilterOperator: removesuffix]], [[FilterOperator: prefix]], [[FilterOperator: removeprefix]], [[FilterOperator: addprefix]], and [[FilterOperator: addsuffix]]. +<<.operator-examples "suffix">> diff --git a/editions/tw5.com/tiddlers/filters/syntax/FilterExpression.tid b/editions/tw5.com/tiddlers/filters/syntax/FilterExpression.tid new file mode 100644 index 000000000..694f44dc2 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/syntax/FilterExpression.tid @@ -0,0 +1,28 @@ +created: 20150124182421000 +modified: 20150124184900000 +tags: [[Filter Syntax]] +title: Filter Expression +type: text/vnd.tiddlywiki + +<$railroad text=""" +[{: + [: [[whitespace|"Filter Whitespace"]] ] + ("+"|:-|"-") + [[run|"Filter Run"]] +}] +"""/> + +A <<.def "filter expression">> is the outermost level of the [[filter syntax|Filter Syntax]]. It consists of one or more [[runs|Filter Run]]. + +A run's input is normally a list of all the non-[[shadow|ShadowTiddlers]] tiddler titles in the wiki (in no particular order). But the `+` prefix can change this. + +* If a run has no `+` or `-` prefix, its output titles are [[dominantly appended|Dominant Append]] to the filter's output. +* If a run has a `-` prefix, its output titles are <<.em removed>> from the filter's output (if they were present). +* If a run has a `+` prefix, it receives the filter's output so far as its input. The filter's output is then completely <<.em replaced>> by the run's output. Any subsequent run reverts to receiving all tiddler titles as its input, unless it too has a `+` prefix. + +In concise technical terms: + +|!Run |!Interpretation |!Output | +|`run` |union of sets |... OR run | +|`+run` |intersection of sets |... AND run | +|`-run` |difference of sets |... AND NOT run | diff --git a/editions/tw5.com/tiddlers/filters/syntax/FilterParameter.tid b/editions/tw5.com/tiddlers/filters/syntax/FilterParameter.tid new file mode 100644 index 000000000..a3f734bfe --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/syntax/FilterParameter.tid @@ -0,0 +1,27 @@ +created: 20151714300000000 +modified: 20150124191518000 +tags: [[Filter Syntax]] +title: Filter Parameter +type: text/vnd.tiddlywiki + +<$railroad text=""" +( "[" [:{/"anything but ]"/}] "]" + | + "{" [:{/"anything but }"/}] "}" + | + "<" [:{/"anything but >"/}] ">" +) +"""/> + +The parameter to a [[filter operator|Filter Operators]] can be: + +;<<.def hard>> +: `[like this]` +: The parameter is the exact text that appears between the square brackets. +;<<.def soft>> +: <<.def indirect>> +:: `{like this}` +:: The parameter is the text indicated by the [[text reference|TextReference]] whose name appears between the curly brackets, i.e. a [[field|TiddlerFields]] of a specified tiddler, or the value of a property of a specified [[data tiddler|DataTiddlers]]. +: <<.def variable>> +:: `` +:: The parameter is the current value of the [[variable|Variables]] whose name appears between the angle brackets. diff --git a/editions/tw5.com/tiddlers/filters/syntax/FilterRun.tid b/editions/tw5.com/tiddlers/filters/syntax/FilterRun.tid new file mode 100644 index 000000000..ecc5e381b --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/syntax/FilterRun.tid @@ -0,0 +1,26 @@ +created: 20150124182117000 +modified: 20150124190233000 +tags: [[Filter Syntax]] +title: Filter Run +type: text/vnd.tiddlywiki + +<$railroad text=""" +( "[" { [[step|"Filter Step"]] } "]" + | + [:{/"anything but [ ] or whitespace"/}] + | + '"' [:{/'anything but "'/}] '"' + | + "'" [:{/"anything but '"/}] '"' +) +"""/> + +A <<.def run>> consists of [[steps|Filter Step]], and it outputs a [[selection|Title Selection]] that contributes to a larger [[filter expression|Filter Expression]]. + +The steps are processed from left to right. The input to the first step is same as the input to the run. For each subsequent step, the input is the output of the previous step. + +{{Absolute Operators}} + +The lower three options in the diagram match syntax like `HelloThere`, `"HelloThere"`, `'HelloThere'` and `"Filter Operators"`. They are short for `[title[...]]`. + +The quoted options exist to support titles that contain square brackets, as in `"An [[[[Unusual]]]] Tiddler"`. diff --git a/editions/tw5.com/tiddlers/filters/syntax/FilterStep.tid b/editions/tw5.com/tiddlers/filters/syntax/FilterStep.tid new file mode 100644 index 000000000..0b8a149e8 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/syntax/FilterStep.tid @@ -0,0 +1,21 @@ +created: 20150124182127000 +modified: 20150124191051000 +tags: [[Filter Syntax]] +title: Filter Step +type: text/vnd.tiddlywiki + +<$railroad text=""" +[:"!"] +[: [[operator|"Filter Operators"]] [:":" suffix] ] +[[parameter|"Filter Parameter"]] +"""/> + +A <<.def step>> represents a single operation within a [[filter|Filter Syntax]]. + +In programming terms, it is akin to a function call to which [[the step's input|Filter Run]] is passed as an implicit parameter. A step's output is a [[selection|Title Selection]] that contributes to a [[run|Filter Run]] and hence to the entire [[filter expression|Filter Expression]] that contains it. + +The step's <<.def operator>> is drawn from a list of [[predefined keywords|Filter Operators]], which can be extended by plugins. Any unrecognised operator is treated as if it was the suffix to the <<.olink field>> operator. If a step's operator is omitted altogether, it defaults to `title`. + +The <<.def suffix>> is additional text, often the name of a [[field|TiddlerFields]], that extends the meaning of certain operators. + +Many steps require an explicit <<.def parameter>> value, also known as an <<.def operand>>, that further defines what the step is to do. diff --git a/editions/tw5.com/tiddlers/filters/syntax/FilterSyntax.tid b/editions/tw5.com/tiddlers/filters/syntax/FilterSyntax.tid new file mode 100644 index 000000000..0190aabab --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/syntax/FilterSyntax.tid @@ -0,0 +1,18 @@ +created: 20140210141217955 +modified: 20150124184229000 +tags: Filters +title: Filter Syntax +type: text/vnd.tiddlywiki +list: [[Filter Expression]] [[Filter Run]] [[Filter Step]] [[Filter Parameter]] [[Filter Whitespace]] + +<<.preamble """[[Filters]] follow a grammar that is presented here, using [[railroad diagrams|Railroad Diagrams]], for those who find formal syntax descriptions helpful. However, you can [[learn to write filters|Introduction to filter notation]] without needing to understand this group of tiddlers.""">> + +A <<.def filter>> is a pipeline for transforming an <<.def input>> into an <<.def output>>. Both the input and the output are [[ordered sets of titles|Title Selection]] of things like tiddlers and fields. + +Filters are [[expressions|Filter Expression]] constructed from smaller building blocks, called [[runs|Filter Run]] and [[steps|Filter Step]], each of which also transforms an input to an output. + +A filter starts with an empty output. Its runs are processed from left to right, progressively modifying the output. + +Here are details of the various building blocks involved: + +<> diff --git a/editions/tw5.com/tiddlers/filters/syntax/FilterWhitespace.tid b/editions/tw5.com/tiddlers/filters/syntax/FilterWhitespace.tid new file mode 100644 index 000000000..25a40161e --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/syntax/FilterWhitespace.tid @@ -0,0 +1,11 @@ +created: 20150124182304000 +modified: 20150124185309000 +tags: [[Filter Syntax]] +title: Filter Whitespace +type: text/vnd.tiddlywiki + +<$railroad text=""" +{( "space" | "tab" | "linefeed" | "return" | "vertical tab" | "formfeed" )} +"""/> + +At least one whitespace character must appear between each [[run|Filter Run]] of a [[filter expression|Filter Expression]]. diff --git a/editions/tw5.com/tiddlers/filters/tag.tid b/editions/tw5.com/tiddlers/filters/tag.tid index f6acba4d2..d908a9950 100644 --- a/editions/tw5.com/tiddlers/filters/tag.tid +++ b/editions/tw5.com/tiddlers/filters/tag.tid @@ -1,19 +1,21 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters CommonFilters -title: FilterOperator: tag -caption: tag +modified: 20150124205948000 +tags: [[Filter Operators]] [[Common Operators]] [[Tag Operators]] [[Negatable Operators]] +title: tag Operator type: text/vnd.tiddlywiki +caption: tag +purpose: filter the input by tag -The ''tag'' filter operator returns the tiddlers in the current list that have the tag specified in the operand. Preceding the operator with `!` returns tiddlers that do not have the specified tag. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="the title of a [[tag|Tagging]]" +paramName="t" +output="those input tiddlers that have tag <<.place t>>" +negationOutput="those input tiddlers that do <<.em not>> have tag <<.place t>>" +/> -For example: +The output is [[sorted|Order of Tagged Tiddlers]] using the tag's <<.field list>> field and the tiddlers' <<.field list-before>> and <<.field list-after>> fields. -|!Filter String |!Description | -|`[tag[mytag]]` |Returns all tiddlers tagged `mytag` | -|`[all[shadows]tag[mytag]]` |Returns all ShadowTiddlers tagged `mytag` | -|`[all[shadows+tiddlers]tag[mytag]]` |Returns all ShadowTiddlers and non-ShadowTiddlers tagged `mytag` | -|`[!tag[mytag]]` |Returns all tiddlers not tagged `mytag` | -|`[tag[mytag]!tag[exclude]]` |Returns all tiddlers tagged `mytag` that are not tagged `exclude` | +If <<.place t>> is empty, the output of `tag` is empty, and the output of `!tag` is a copy of the input. -See also [[FilterOperator: tagging]], [[FilterOperator: tags]] and [[FilterOperator: untagged]]. +<<.operator-examples "tag">> diff --git a/editions/tw5.com/tiddlers/filters/tagging.tid b/editions/tw5.com/tiddlers/filters/tagging.tid index b2015a8c3..c8ccce101 100644 --- a/editions/tw5.com/tiddlers/filters/tagging.tid +++ b/editions/tw5.com/tiddlers/filters/tagging.tid @@ -1,16 +1,17 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -title: FilterOperator: tagging -caption: tagging +modified: 20150124205941000 +tags: [[Filter Operators]] [[Tag Operators]] +title: tagging Operator type: text/vnd.tiddlywiki +caption: tagging +purpose: find the tiddlers that have the input tags -The ''tagging'' filter operator returns all the tiddlers that are tagged by the tiddlers in the current list. +<$macrocall $name=".operator-def" +input="a [[selection|Title Selection]] of [[tags|Tagging]]" +parameter="none" +output="the titles of any tiddlers that carry the input tags" +/> -For example: +Each input tag is processed in turn. The list of tiddlers carrying that tag is generated, [[sorted|Order of Tagged Tiddlers]], and then [[dominantly appended|Dominant Append]] to the operator's overall output. -|!Filter String |!Description | -|`[[mytag]tagging[]]` |Returns all tiddlers tagged `mytag` | -|`[all[current]tagging[]]` |Returns all tiddlers tagged by the current tiddler | - -See also [[FilterOperator: tag]], [[FilterOperator: tags]] and [[FilterOperator: untagged]]. +<<.operator-examples "tagging">> diff --git a/editions/tw5.com/tiddlers/filters/tags.tid b/editions/tw5.com/tiddlers/filters/tags.tid index 04e684d7c..7dc972fd4 100644 --- a/editions/tw5.com/tiddlers/filters/tags.tid +++ b/editions/tw5.com/tiddlers/filters/tags.tid @@ -1,16 +1,17 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -title: FilterOperator: tags -caption: tags +modified: 20150124210613000 +tags: [[Filter Operators]] [[Tag Operators]] +title: tags Operator type: text/vnd.tiddlywiki +caption: tags +purpose: select all tags of the input tiddlers -The ''tags'' filter operator returns all the tags present on the tiddlers in the current list. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="none" +output="all the tags carried by the input tiddlers" +/> -For example: +Each input title is processed in turn. The corresponding tiddler's tags are retrieved (in order of appearance in the <<.field tags>> field) and then [[dominantly appended|Dominant Append]] to the operator's output. -|!Filter String |!Description | -|`[[mytiddler]tags[]]` |Returns all tags for the tiddler `mytiddler` | -|`[all[shadows+tiddlers]tags[]]` |Returns all the tags used on ShadowTiddlers or non-ShadowTiddlers | - -See also [[FilterOperator: tag]], [[FilterOperator: tagging]] and [[FilterOperator: untagged]]. +<<.operator-examples "tags">> diff --git a/editions/tw5.com/tiddlers/filters/title.tid b/editions/tw5.com/tiddlers/filters/title.tid index f4a9780f9..5dda38e29 100644 --- a/editions/tw5.com/tiddlers/filters/title.tid +++ b/editions/tw5.com/tiddlers/filters/title.tid @@ -1,16 +1,22 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -title: FilterOperator: title -caption: title +modified: 20150124192051000 +tags: [[Filter Operators]] [[Common Operators]] [[Absolute Operators]] [[Negatable Operators]] +title: title Operator type: text/vnd.tiddlywiki +caption: title +purpose: select a single title -The ''title'' filter operator replaces the current list with the title specified in the operand. +<$macrocall $name=".operator-def" +input="ignored" +negationInput="a [[selection of titles|Title Selection]]" +parameter="a tiddler title" +paramName="t" +output="a selection containing only <<.place t>>" +negationOutput="the input, but with tiddler <<.place t>> filtered out if it exists in the wiki" +/> -For example: +`[title[An Example]]` can be shortened to `[[An Example]]`, because <<.op title>> is the default filter operator. -|!Filter String |!Description | -|`[[mytiddler]]` |Returns the title `mytiddler` | -|`[title[mytiddler]]` |Returns the title `mytiddler` | +<<.op title>> is an [[absolute operator|Absolute Operators]] (except in the form `!title`), but <<.olink2 "field:title" field>> is relative. -Note that the ''title'' operator is the default when no operator name is specified. +<<.operator-examples "title">> diff --git a/editions/tw5.com/tiddlers/filters/untagged.tid b/editions/tw5.com/tiddlers/filters/untagged.tid index caac74ea4..84ed30f5c 100644 --- a/editions/tw5.com/tiddlers/filters/untagged.tid +++ b/editions/tw5.com/tiddlers/filters/untagged.tid @@ -1,16 +1,22 @@ created: 20140410103123179 -modified: 20140410103123179 -tags: Filters -title: FilterOperator: untagged -caption: untagged +modified: 20150124192055000 +tags: [[Filter Operators]] [[Tag Operators]] [[Negatable Operators]] +title: untagged Operator type: text/vnd.tiddlywiki +caption: untagged +purpose: discard any input titles that have tags -The ''untagged'' filter operator selects from the current list any tiddlers that do not have any tags. +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="none" +output="those input tiddlers that have no tags" +negationOutput="those input tiddlers that have at least one tag" +/> -For example: +A tiddler is deemed to have no tags if it: -|!Filter String |!Description | -|`[untagged[]]` |Returns the titles of all tiddlers without tags | -|`[all[shadows]untagged[]]` |Returns all the ShadowTiddlers without tags | +* doesn't exist +* doesn't have a <<.field tags>> field +* has an empty <<.field tags>> field -See also [[FilterOperator: tag]], [[FilterOperator: tagging]] and [[FilterOperator: tags]]. +<<.operator-examples "untagged">> diff --git a/editions/tw5.com/tiddlers/howtos/Structuring TiddlyWiki.tid b/editions/tw5.com/tiddlers/howtos/Structuring TiddlyWiki.tid index e4b292cb1..b0d6f34d3 100644 --- a/editions/tw5.com/tiddlers/howtos/Structuring TiddlyWiki.tid +++ b/editions/tw5.com/tiddlers/howtos/Structuring TiddlyWiki.tid @@ -1,5 +1,5 @@ created: 20131128090536894 -modified: 20140919155834905 +modified: 20150124211518000 tags: [[Working with TiddlyWiki]] title: Structuring TiddlyWiki type: text/vnd.tiddlywiki @@ -8,5 +8,5 @@ TiddlyWiki5 provides several features to help you structure information as [[tid * TiddlerLinks * [[Tagging]] -* TiddlerLists +* [[Title Lists|Title List]] * DataTiddlers diff --git a/editions/tw5.com/tiddlers/howtos/Tagging.tid b/editions/tw5.com/tiddlers/howtos/Tagging.tid index 158ad7fe7..cfcf93f7b 100644 --- a/editions/tw5.com/tiddlers/howtos/Tagging.tid +++ b/editions/tw5.com/tiddlers/howtos/Tagging.tid @@ -1,5 +1,5 @@ created: 20140904075400000 -modified: 20150119191356000 +modified: 20150124202936000 tags: [[Working with TiddlyWiki]] Concepts title: Tagging type: text/vnd.tiddlywiki @@ -35,11 +35,6 @@ You can use the [[tag manager|$:/TagManager]], found on the ''Tags'' tab under ' By default, tagged tiddlers are listed in the order they were added to the wiki. The <<.olink sort>> operator can change the order to alphabetical. -If you want any other order, add a [[field called ''list''|ListField]] to the tag tiddler, and set its value to be a [[list of the tiddlers|Title Lists]] in that order. +If you want any other order, add a <<.flink ListField>> field to the tag tiddler, and set its value to be a [[list of the tiddlers|Title List]] in that order. -The ''list'' field doesn't have to mention all of the tiddlers. Here are the precise rules ~TiddlyWiki uses to order tagged tiddlers: - -# Start with the tiddlers in the ''list'' field, in the sequence given there. -# In each remaining tiddler, look for a ''list-before'' field. If this has a tiddler title as its value, insert the tiddler into the sequence just before that one. As a special case, if the field's value is blank, add the tiddler at the very start of the sequence. -# In each remaining tiddler, look for a ''list-after'' field. If this has a tiddler title as its value, insert the tiddler into the sequence just after that one. -# If any tiddlers still remain, add them to the very end of the sequence. +The ''list'' field doesn't have to mention all of the tiddlers. See the [[precise rules|Order of Tagged Tiddlers]] ~TiddlyWiki uses to order tagged tiddlers. diff --git a/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.14beta.tid b/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.14beta.tid index 2aeec4f68..54c8eff57 100644 --- a/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.14beta.tid +++ b/editions/tw5.com/tiddlers/releasenotes/beta/Release 5.0.14beta.tid @@ -1,6 +1,6 @@ caption: 5.0.14-beta created: 20140718150234142 -modified: 20140813153116300 +modified: 20150124211128000 tags: BetaReleaseNotes title: Release 5.0.14-beta type: text/vnd.tiddlywiki @@ -57,8 +57,8 @@ For 5.0.14-beta, the setting has been changed. Visit [[control panel|$:/ControlP * [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/c23f6af4b5c59f4d09dd8d6704e1939bb9d5b2d3]] TiddlerWidget to add a CSS class corresponding to each tag present on displayed tiddlers * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/d357e1706c91d17a72fb19fedf43e57071fc7dd6]] support for hiding specified fields in the tiddler editor -* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/be040ea8a2cc8962f1a28a313e4c9ebc2d5c0e31]] support for variable operands in filters (see [[Introduction to Filters]]) -* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/1f16ef6fa88b51d2dad7c8e57fcff014950a7442]] support for widget messages [[tw-permalink|WidgetMessage: tw-permalink]] and [[tw-permaview|WidgetMessage: tw-permaview]] +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/be040ea8a2cc8962f1a28a313e4c9ebc2d5c0e31]] support for variable operands in filters (see [[Filter Parameter]]) +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/1f16ef6fa88b51d2dad7c8e57fcff014950a7442]] support for widget messages [[tw-permalink|WidgetMessage: tw-permalink]] and [[tw-permaview|WidgetMessage: tw-permaview]] * [[Added|https://github.com/Jermolene/TiddlyWiki5/tree/master/plugins/tiddlywiki/browser-sniff]] browser sniffing plugin so that tiddlywiki.com can present the correct browser-specific documentation * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/ef67cc3fd9b267a522598abccdfbb93fbfca240c]] a configuration option for specifying the default location for saving new tiddlers in the client-server configuration * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/b4d47858e587c96f3a68cc28cffff181ec45f55f]] support for the InfoMechanism diff --git a/editions/tw5.com/tiddlers/styleguide/Documentation Macros.tid b/editions/tw5.com/tiddlers/styleguide/Documentation Macros.tid index 7c3da4ced..31c8ffe1f 100644 --- a/editions/tw5.com/tiddlers/styleguide/Documentation Macros.tid +++ b/editions/tw5.com/tiddlers/styleguide/Documentation Macros.tid @@ -1,5 +1,5 @@ created: 20150110182600000 -modified: 20150117180524000 +modified: 20150123221155000 title: Documentation Macros tags: [[Improving TiddlyWiki Documentation]] @@ -21,13 +21,14 @@ The following macros are used throughout ~TiddlyWiki's documentation. !Tiddlers and fields |!Macro |!Used for |!Example | -|.tid |a tiddler title|<<.tid Example>> | +|.tid |a tiddler title |<<.tid Example>> | |.tag |a tag |<<.tag Example>> | -|.field|a field name|<<.field example>> | -|.value|a field value|<<.value "example value">> | -|.op|a filter operator|<<.op backlinks>> | -|.var|a variable or macro name|<<.var currentTiddler>> | -|.wid|a widget name|<<.wid list>> | +|.field |a field name |<<.field example>> | +|.value |a field value |<<.value "example value">> | +|.op |a filter operator |<<.op backlinks>> | +|.var |a variable or macro nam e|<<.var currentTiddler>> | +|.wid |a widget name |<<.wid list>> | +|.attr |an attribute name |<<.attr filter>> | !Links diff --git a/editions/tw5.com/tiddlers/system/doc-macros.tid b/editions/tw5.com/tiddlers/system/doc-macros.tid index 4d6e840ed..810c0e870 100644 --- a/editions/tw5.com/tiddlers/system/doc-macros.tid +++ b/editions/tw5.com/tiddlers/system/doc-macros.tid @@ -1,10 +1,8 @@ created: 20150117152607000 -modified: 20150118182742000 +modified: 20150124180333000 title: $:/editions/tw5.com/doc-macros tags: $:/tags/Macro -\define .if(cond,then,else) <$reveal default="$cond$" type="nomatch" text="">$then$<$reveal default="$cond$" type="match" text="">$else$ - \define .def(_) $_$ \define .em(_) $_$ \define .strong(_) $_$ @@ -12,6 +10,12 @@ tags: $:/tags/Macro \define .word(_) "$_$" \define .preamble(_) :.doc-preamble $_$ +\define .note(_) +@@.doc-note +;Note +: $_$ +@@ +\end \define .tid(_) $_$ \define .tag(_) $_$ @@ -19,7 +23,8 @@ tags: $:/tags/Macro \define .value(_) $_$ \define .op(_) $_$ \define .var(_) $_$ -\define .widget(_) $$_$ +\define .wid(_) $$_$ +\define .attr(_) $_$ \define .otitle(_) $_$ Operator diff --git a/editions/tw5.com/tiddlers/system/doc-styles.tid b/editions/tw5.com/tiddlers/system/doc-styles.tid index 4e55d04a8..91ea7ec4e 100644 --- a/editions/tw5.com/tiddlers/system/doc-styles.tid +++ b/editions/tw5.com/tiddlers/system/doc-styles.tid @@ -1,5 +1,5 @@ created: 20150117152612000 -modified: 20150118161750000 +modified: 20150124201551000 title: $:/editions/tw5.com/doc-styles tags: $:/tags/Stylesheet @@ -39,7 +39,8 @@ tags: $:/tags/Stylesheet .doc-value, .doc-operator, .doc-var, -.doc-widget { +.doc-widget, +.doc-attr { background-color: <>; border: none; color: <>; @@ -56,7 +57,8 @@ a .doc-field, a .doc-value, a .doc-operator, a .doc-var, -a .doc-widget { +a .doc-widget, +a .doc-attr { color: <>; } @@ -78,13 +80,21 @@ td svg { } .doc-preamble { - border: 2px solid <>; + border: 2px solid <>; color: <>; font-size: 90%; margin-left: 0; padding: 0.5em 0.7em; } +.doc-note dt { + color: <>; +} +.doc-note dd { + border-left: 2px solid <>; + padding-left: 0.6em; +} + .doc-example { margin: 1em 0; padding: 0.8em 0; @@ -97,3 +107,15 @@ td svg { padding-bottom: 0; margin-top: 0.2em; } + +.doc-table th, .doc-table tr { + vertical-align: top; +} +.doc-table th a { + font-weight: bold; +} + +tr.doc-table-subheading { + height: 2em; + vertical-align: middle; +} diff --git a/editions/tw5.com/tiddlers/system/if-macro.js b/editions/tw5.com/tiddlers/system/if-macro.js new file mode 100644 index 000000000..87d4f07dc --- /dev/null +++ b/editions/tw5.com/tiddlers/system/if-macro.js @@ -0,0 +1,26 @@ +/*\ +title: $:/editions/tw5.com/if-macro.js +type: application/javascript +module-type: macro +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +exports.name = ".if"; + +exports.params = [ + { name: "cond" }, + { name: "then" }, + { name: "else" } +]; + +exports.run = function(cond, then, elze) { + then = then || ""; + elze = elze || ""; + return cond ? then : elze; +}; + +})(); \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/system/operator-macros.tid b/editions/tw5.com/tiddlers/system/operator-macros.tid index 55ab81cb4..ada7f0f61 100644 --- a/editions/tw5.com/tiddlers/system/operator-macros.tid +++ b/editions/tw5.com/tiddlers/system/operator-macros.tid @@ -1,43 +1,33 @@ created: 20150117152607000 -modified: 20150119193041000 +modified: 20150124210351000 title: $:/editions/tw5.com/operator-macros tags: $:/tags/Macro -\define .operator-def(input,parameter,paramName,output) - - - - - - - - - -
input$input$
parameter<$macrocall $name=".if" cond="$paramName$" then=" <<.place '$paramName$'>>"/>$parameter$
output$output$
+\define .operator-def(input,negationInput,suffix,suffixName,parameter,paramName,output,negationOutput) + + + +<$macrocall $name=".if" cond="""$negationInput$""" +then="""""" +else=""/> +<$macrocall $name=".if" cond="""$suffix$""" +then="""""" +else=""/> + + +<$macrocall $name=".if" cond="""$negationOutput$""" +then="""""" +else=""/> +
purpose{{!!purpose}}
[[input|Filter Syntax]]$input$
`!` input$negationInput$
[[suffix|Filter Step]] <<.place "$suffixName$">>$suffix$
[[parameter|Filter Parameter]]<$macrocall $name=".if" cond="""$paramName$""" +then=" <<.place '$paramName$'>>" else=""/>$parameter$
output$output$
`!` output$negationOutput$
\end -\define .operator-def-suffix(input,suffix,suffixName,parameter,paramName,output) - - - - - - - - - - - - -
input$input$
suffix <<.place "$suffixName$">>$suffix$
parameter<$macrocall $name=".if" cond="$paramName$" then=" <<.place '$paramName$'>>"/>$parameter$
output$output$
-\end - -\define .operator-examples(op) <$link to="$op$ Operator (Examples)">Examples +\define .operator-examples(op,text:"Examples") <$link to="$op$ Operator (Examples)">$text$ \define .operator-example(n,eg,ie)
`$eg$` -<<.if cond:"$ie$" then:"
$ie$
">> +<$macrocall $name=".if" cond="""$ie$""" then="""
→ $ie$
"""/> <$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix[$n$]]" variable=".state"> <$reveal state=<<.state>> type="nomatch" text="show">
@@ -57,4 +47,10 @@ tags: $:/tags/Macro \define .this-is-operator-example() This example tiddler is used to illustrate some of the [[Filter Operators]]. \define .using-days-of-week() These examples make use of the [[Days of the Week]] tiddler. -\define .node-only-operator() This operator is <<.em not>> available when ~TiddlyWiki is running in a web browser. +\define .s-matching-is-case-sensitive() In looking for matches for <<.place s>>, capital and lowercase letters are treated as different. + +\define .node-only-operator() + +<$macrocall $name=".note" _="This operator is <<.em not>> available when ~TiddlyWiki is running in a web browser."/> + +\end diff --git a/editions/tw5.com/tiddlers/workingwithtw/Creating journal tiddlers.tid b/editions/tw5.com/tiddlers/workingwithtw/Creating journal tiddlers.tid index 495b3c5fd..e6fa8417b 100644 --- a/editions/tw5.com/tiddlers/workingwithtw/Creating journal tiddlers.tid +++ b/editions/tw5.com/tiddlers/workingwithtw/Creating journal tiddlers.tid @@ -1,5 +1,5 @@ created: 20141010093214683 -modified: 20150119191403000 +modified: 20150124202942000 tags: [[Working with TiddlyWiki]] title: Creating journal tiddlers type: text/vnd.tiddlywiki @@ -29,7 +29,7 @@ For example, you might be reviewing a tiddler called ''Oxford Street'' and reali To configure how new journal entries are created, visit the ''Basics'' tab under ''Info'' in the [[control panel|$:/ControlPanel]]: * "Title of new journal tiddlers" specifies how these tiddlers should be named, as a [[date format string|DateFormat]]. The default setting of `DDth MMM YYYY` causes new entries to have titles of the form "10th October 2014" -* "Tags for new journal tiddlers" [specifies|Title Lists] tags that will automatically appear on new journal entries. For example: `Journal [[Summer vacation]]` +* "Tags for new journal tiddlers" [specifies|Title List] tags that will automatically appear on new journal entries. For example: `Journal [[Summer vacation]]` Hint: if you want to create a separate journal tiddler whenever you click ''new journal'' (even if you do this several times in the same day), you can include the clock time in the title format. Specify something like `YYYY-0MM-0DD at 0hhh0mm'0ss''` as the date format. From 15f05b076c0c0cb8198c282dbd70debe082480d7 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Sat, 24 Jan 2015 21:53:28 +0000 Subject: [PATCH 07/10] Retarget a couple of links and add trailing linefeeds --- editions/tw5.com/tiddlers/concepts/DateFields.tid | 4 ++-- editions/tw5.com/tiddlers/filters/eachday.tid | 4 ++-- editions/tw5.com/tiddlers/filters/sameday.tid | 4 ++-- editions/tw5.com/tiddlers/system/if-macro.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/editions/tw5.com/tiddlers/concepts/DateFields.tid b/editions/tw5.com/tiddlers/concepts/DateFields.tid index 33eb37cb9..9c1bfa618 100644 --- a/editions/tw5.com/tiddlers/concepts/DateFields.tid +++ b/editions/tw5.com/tiddlers/concepts/DateFields.tid @@ -1,5 +1,5 @@ created: 20150117190213631 -modified: 20150117191804000 +modified: 20150124214537000 tags: Concepts title: Date Fields type: text/vnd.tiddlywiki @@ -25,4 +25,4 @@ As an example, the <<.field created>> field of this tiddler has the value <<.val Dates can be [[converted to other formats|DateFormat]] for display: <$macrocall $name="wikitext-example-without-html" -src="""<$view field="created" format="date" template="DDD DDth MMM YYYY"/>"""> \ No newline at end of file +src="""<$view field="created" format="date" template="DDD DDth MMM YYYY"/>"""> diff --git a/editions/tw5.com/tiddlers/filters/eachday.tid b/editions/tw5.com/tiddlers/filters/eachday.tid index b1fcdb712..d8c8ff20a 100644 --- a/editions/tw5.com/tiddlers/filters/eachday.tid +++ b/editions/tw5.com/tiddlers/filters/eachday.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20150124164959000 +modified: 20150124214554000 tags: [[Filter Operators]] [[Group Operators]] [[Date Operators]] title: eachday Operator type: text/vnd.tiddlywiki @@ -8,7 +8,7 @@ purpose: select one of each group of input titles by date <$macrocall $name=".operator-def" input="a [[selection of titles|Title Selection]]" -parameter="the name of a date [[field|TiddlerFields]]" +parameter="the name of a [[date field|Date Fields]]" paramName="f" output="a selection containing the first input title encountered for each distinct value (ignoring times of day) of field <<.place f>>" /> diff --git a/editions/tw5.com/tiddlers/filters/sameday.tid b/editions/tw5.com/tiddlers/filters/sameday.tid index 6285288c1..03580ea9c 100644 --- a/editions/tw5.com/tiddlers/filters/sameday.tid +++ b/editions/tw5.com/tiddlers/filters/sameday.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20150124191743000 +modified: 20150124214612000 tags: [[Filter Operators]] [[Date Operators]] title: sameday Operator type: text/vnd.tiddlywiki @@ -8,7 +8,7 @@ purpose: filter the input by date <$macrocall $name=".operator-def" input="a [[selection of titles|Title Selection]]" -suffix="the name of a date [[field|TiddlerFields]], defaulting to <<.field modified>>" +suffix="the name of a [[date field|Date Fields]], defaulting to <<.field modified>>" suffixName="f" parameter="a date, in the [[format|DateFormat]] `YYYYMMDD`" paramName="d" diff --git a/editions/tw5.com/tiddlers/system/if-macro.js b/editions/tw5.com/tiddlers/system/if-macro.js index 87d4f07dc..6c902ed65 100644 --- a/editions/tw5.com/tiddlers/system/if-macro.js +++ b/editions/tw5.com/tiddlers/system/if-macro.js @@ -23,4 +23,4 @@ exports.run = function(cond, then, elze) { return cond ? then : elze; }; -})(); \ No newline at end of file +})(); From 88ea60cc7eb8dcdd1b92a1dac3aa06bf59f91245 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Sun, 25 Jan 2015 10:53:56 +0000 Subject: [PATCH 08/10] correction to statement about filter whitespace --- editions/tw5.com/tiddlers/filters/syntax/FilterWhitespace.tid | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editions/tw5.com/tiddlers/filters/syntax/FilterWhitespace.tid b/editions/tw5.com/tiddlers/filters/syntax/FilterWhitespace.tid index 25a40161e..f31422b3d 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/FilterWhitespace.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/FilterWhitespace.tid @@ -1,5 +1,5 @@ created: 20150124182304000 -modified: 20150124185309000 +modified: 20150125105243000 tags: [[Filter Syntax]] title: Filter Whitespace type: text/vnd.tiddlywiki @@ -8,4 +8,4 @@ type: text/vnd.tiddlywiki {( "space" | "tab" | "linefeed" | "return" | "vertical tab" | "formfeed" )} """/> -At least one whitespace character must appear between each [[run|Filter Run]] of a [[filter expression|Filter Expression]]. +Whitespace characters can appear between each [[run|Filter Run]] of a [[filter expression|Filter Expression]]. From 89163e0e851cf77d845e560fb0ca41cca520d5f2 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Mon, 26 Jan 2015 09:26:24 +0000 Subject: [PATCH 09/10] Adjust style of filter operator placeholders --- editions/tw5.com/tiddlers/system/doc-styles.tid | 8 +++++--- editions/tw5.com/tiddlers/system/operator-macros.tid | 7 +++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/editions/tw5.com/tiddlers/system/doc-styles.tid b/editions/tw5.com/tiddlers/system/doc-styles.tid index 91ea7ec4e..75914c677 100644 --- a/editions/tw5.com/tiddlers/system/doc-styles.tid +++ b/editions/tw5.com/tiddlers/system/doc-styles.tid @@ -1,5 +1,5 @@ created: 20150117152612000 -modified: 20150124201551000 +modified: 20150126091948000 title: $:/editions/tw5.com/doc-styles tags: $:/tags/Stylesheet @@ -27,8 +27,10 @@ tags: $:/tags/Stylesheet .doc-place { background-color: <>; border: none; - color: <>; - font-style: italic; + color: <>; + font-style: normal; + font-weight: bold; + text-transform: uppercase; } .doc-button, diff --git a/editions/tw5.com/tiddlers/system/operator-macros.tid b/editions/tw5.com/tiddlers/system/operator-macros.tid index ada7f0f61..8f36a4337 100644 --- a/editions/tw5.com/tiddlers/system/operator-macros.tid +++ b/editions/tw5.com/tiddlers/system/operator-macros.tid @@ -1,5 +1,5 @@ created: 20150117152607000 -modified: 20150124210351000 +modified: 20150126092438000 title: $:/editions/tw5.com/operator-macros tags: $:/tags/Macro @@ -11,10 +11,9 @@ tags: $:/tags/Macro then="""`!` input$negationInput$""" else=""/> <$macrocall $name=".if" cond="""$suffix$""" -then="""[[suffix|Filter Step]] <<.place "$suffixName$">>$suffix$""" +then="""[[suffix|Filter Step]]<<.place "$suffixName$:">> $suffix$""" else=""/> -[[parameter|Filter Parameter]]<$macrocall $name=".if" cond="""$paramName$""" -then=" <<.place '$paramName$'>>" else=""/>$parameter$ +[[parameter|Filter Parameter]]<$macrocall $name=".if" cond="""$paramName$""" then="<<.place '$paramName$:'>>" else=""/>$parameter$ output$output$ <$macrocall $name=".if" cond="""$negationOutput$""" then="""`!` output$negationOutput$""" From baceb21fbbb8f7afea88c6be643af559cf5f2d06 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Mon, 26 Jan 2015 14:42:22 +0000 Subject: [PATCH 10/10] Document splitbefore and storyviews operators --- .../tiddlers/filters/examples/splitbefore.tid | 8 ++++++ .../tiddlers/filters/examples/storyviews.tid | 7 ++++++ .../examples/{tag - Copy.tid => untagged.tid} | 0 .../tw5.com/tiddlers/filters/splitbefore.tid | 25 +++++++++++++++++++ .../tw5.com/tiddlers/filters/storyviews.tid | 17 +++++++++++++ .../tiddlers/system/operator-macros.tid | 6 ++--- 6 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 editions/tw5.com/tiddlers/filters/examples/splitbefore.tid create mode 100644 editions/tw5.com/tiddlers/filters/examples/storyviews.tid rename editions/tw5.com/tiddlers/filters/examples/{tag - Copy.tid => untagged.tid} (100%) create mode 100644 editions/tw5.com/tiddlers/filters/splitbefore.tid create mode 100644 editions/tw5.com/tiddlers/filters/storyviews.tid diff --git a/editions/tw5.com/tiddlers/filters/examples/splitbefore.tid b/editions/tw5.com/tiddlers/filters/examples/splitbefore.tid new file mode 100644 index 000000000..d8dbda9c1 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/splitbefore.tid @@ -0,0 +1,8 @@ +created: 20150126143216000 +modified: 20150126143901000 +tags: [[splitbefore Operator]] [[Operator Examples]] +title: splitbefore Operator (Examples) +type: text/vnd.tiddlywiki + +<$macrocall $name=".operator-example" n="1" eg="2015-01-26 2014-07-19 2013 +[splitbefore[-]]"/> +<$macrocall $name=".operator-example" n="2" eg="[[green trees]splitbefore[ee]]"/> diff --git a/editions/tw5.com/tiddlers/filters/examples/storyviews.tid b/editions/tw5.com/tiddlers/filters/examples/storyviews.tid new file mode 100644 index 000000000..c824a6fd2 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/storyviews.tid @@ -0,0 +1,7 @@ +created: 20150126142047000 +modified: 20150126142124000 +tags: [[storyviews Operator]] [[Operator Examples]] +title: storyviews Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[storyviews[]]">> diff --git a/editions/tw5.com/tiddlers/filters/examples/tag - Copy.tid b/editions/tw5.com/tiddlers/filters/examples/untagged.tid similarity index 100% rename from editions/tw5.com/tiddlers/filters/examples/tag - Copy.tid rename to editions/tw5.com/tiddlers/filters/examples/untagged.tid diff --git a/editions/tw5.com/tiddlers/filters/splitbefore.tid b/editions/tw5.com/tiddlers/filters/splitbefore.tid new file mode 100644 index 000000000..1178ddeaa --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/splitbefore.tid @@ -0,0 +1,25 @@ +created: 20150126142522000 +modified: 20150126143945000 +tags: [[Filter Operators]] [[String Operators]] +title: splitbefore Operator +type: text/vnd.tiddlywiki +caption: splitbefore +purpose: select a delimited prefix from each input title + +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="a string of characters marking the end of the prefix" +paramName="s" +output="the prefix, up to and including <<.place S>>, of each input title" +/> + +Each input title is processed in turn. + +* A title that contains <<.place s>> contributes everything up to and including <<.place s>>. +* A title that doesn't contain <<.place s>> simply contributes itself to the output. + +Contributions are [[dominantly appended|Dominant Append]] to the output. + +The <<.clink "`toc`" TableOfContentsMacro>> macros use this operator with `/` as the parameter. + +<<.operator-examples "splitbefore">> diff --git a/editions/tw5.com/tiddlers/filters/storyviews.tid b/editions/tw5.com/tiddlers/filters/storyviews.tid new file mode 100644 index 000000000..071f4fe48 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/storyviews.tid @@ -0,0 +1,17 @@ +created: 20150126141718000 +modified: 20150126142035000 +tags: [[Filter Operators]] [[Special Operators]] +title: storyviews Operator +type: text/vnd.tiddlywiki +caption: storyviews +purpose: select the names of all the story views + +<$macrocall $name=".operator-def" +input="ignored" +parameter="none" +output="the name of each story view" +/> + +The names are those exported by [[modules|Modules]] whose <<.field module-type>> is <<.value storyview>>. + +<<.operator-examples "storyviews">> diff --git a/editions/tw5.com/tiddlers/system/operator-macros.tid b/editions/tw5.com/tiddlers/system/operator-macros.tid index 8f36a4337..b56c48cd3 100644 --- a/editions/tw5.com/tiddlers/system/operator-macros.tid +++ b/editions/tw5.com/tiddlers/system/operator-macros.tid @@ -1,5 +1,5 @@ created: 20150117152607000 -modified: 20150126092438000 +modified: 20150126144131000 title: $:/editions/tw5.com/operator-macros tags: $:/tags/Macro @@ -11,9 +11,9 @@ tags: $:/tags/Macro then="""`!` input$negationInput$""" else=""/> <$macrocall $name=".if" cond="""$suffix$""" -then="""[[suffix|Filter Step]]<<.place "$suffixName$:">> $suffix$""" +then="""[[suffix|Filter Step]]<<.place "$suffixName$">> = $suffix$""" else=""/> -[[parameter|Filter Parameter]]<$macrocall $name=".if" cond="""$paramName$""" then="<<.place '$paramName$:'>>" else=""/>$parameter$ +[[parameter|Filter Parameter]]<$macrocall $name=".if" cond="""$paramName$""" then="<<.place '$paramName$'>> = " else=""/>$parameter$ output$output$ <$macrocall $name=".if" cond="""$negationOutput$""" then="""`!` output$negationOutput$"""