From 7290be9e47c1fa64e0b4d052736b10d4355ac5aa Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Sun, 28 Dec 2014 09:50:19 +0000 Subject: [PATCH 1/6] Improvements to wording --- .../tiddlers/concepts/ColourPalettes.tid | 41 +++++++------------ 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/editions/tw5.com/tiddlers/concepts/ColourPalettes.tid b/editions/tw5.com/tiddlers/concepts/ColourPalettes.tid index 5b6890ca6..4e08b2d21 100644 --- a/editions/tw5.com/tiddlers/concepts/ColourPalettes.tid +++ b/editions/tw5.com/tiddlers/concepts/ColourPalettes.tid @@ -4,40 +4,29 @@ tags: Concepts title: ColourPalettes type: text/vnd.tiddlywiki -Colour palettes bind logical colour names (such as ''page-background'') to actual CSS colours (such as ''#fe0''). +A colour palette is a [[data tiddler|DataTiddlers]] that supplies a [[CSS]] colour value, such as ''yellow'' or ''#fe0'', for each of several colour names, like this: -Entire colour palettes are stored in a single [[data tiddler|DataTiddlers]]. +``` +page-background: #fe0 +table-border: #ccc +... +``` -The title of the tiddler containing the current colour palette is identified by the tiddler [[$:/palette]]. +Several palettes form part of the core. The system tiddler [[$:/palette]] always contains the title of the currently selected palette tiddler. -To retrieve a named colour from the current palette you can use the ''colour'' macro: +To retrieve the value of a named colour from the current palette, e.g. for use in a stylesheet tiddler, use the [[colour macro|$:/core/macros/CSS]]: ``` <> ``` -The ''colour'' macro is defined like this: - -``` -\define colour(name) -<$transclude tiddler={{$:/palette}} index="$name$"/> -\end -``` - -By convention, each theme provides a default colour palette in the tiddler [[$:/config/DefaultPalette]] tiddler. Thus, setting the tiddler [[$:/theme]] to the string `$:/config/DefaultPalette` will revert to the palette packaged with the current theme (as long as it hasn't been redefined, since it is a shadow tiddler). - Palette tiddlers should have the following fields: -|!Field |!Description | -|title |Any title can be used, typically a system title starting with "$:/" | -|type |`application/x-tiddler-dictionary` to identify this tiddler as a [[data tiddler|DataTiddlers]] | -|tags |`$:/tags/Palette` to identify this tiddler as a palette | -|description |Description to be displayed in palette browser | -|text |Colour definitions (see below) | +|!Name |!Value | +|title |Typically starting with `$:/` | +|type |`application/x-tiddler-dictionary` | +|tags |`$:/tags/Palette` | +|description |Displayed in the palette browser | +|text |`name: value` colour definitions | -The text of a palette tiddler consists of name value pairs like this: - -``` -foreground: #000 -background: #fff -``` +By convention, each [[theme|Themes]] provides a default colour palette in the tiddler [[$:/config/DefaultPalette]]. Thus, setting the tiddler [[$:/theme]] to the string `$:/config/DefaultPalette` will revert to the palette packaged with the current theme (as long as it hasn't been redefined, since it is a shadow tiddler). From e9c6610d745ddd881760f6047771105b283954b9 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Sun, 28 Dec 2014 09:51:13 +0000 Subject: [PATCH 2/6] Improvements to wording --- editions/tw5.com/tiddlers/concepts/CurrentTiddler.tid | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/editions/tw5.com/tiddlers/concepts/CurrentTiddler.tid b/editions/tw5.com/tiddlers/concepts/CurrentTiddler.tid index bc673c507..9bbf6979d 100644 --- a/editions/tw5.com/tiddlers/concepts/CurrentTiddler.tid +++ b/editions/tw5.com/tiddlers/concepts/CurrentTiddler.tid @@ -4,6 +4,10 @@ tags: Concepts title: CurrentTiddler type: text/vnd.tiddlywiki -The CurrentTiddler is the current tiddler during WikiText rendering. It is usually set by the TiddlerWidget. It allows you to write references like `<$view field="title"/>` in TemplateTiddlers without explicitly specifying the tiddler that it applies to. +The current tiddler provides an ever-changing context or background against which several features of WikiText are interpreted. -The title of the current tiddler is contained in the [[WidgetVariable: currentTiddler]]. +For example, `{{!!title}}` denotes the value of the ''title'' field of whatever the current tiddler happens to be. This technique can be used in a [[TemplateTiddler|TemplateTiddlers]] to keep the template generic. + +The title of the current tiddler can always be found in the [[currentTiddler variable|WidgetVariable: currentTiddler]]. + +The current tiddler is set in several ways, including by the ListWidget and the TiddlerWidget. From 117d10275f3df3150211f63b938e77a5dbb59185 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Sun, 28 Dec 2014 09:51:53 +0000 Subject: [PATCH 3/6] Improvements to wording --- .../tiddlers/concepts/DataTiddlers.tid | 45 ++++++------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/editions/tw5.com/tiddlers/concepts/DataTiddlers.tid b/editions/tw5.com/tiddlers/concepts/DataTiddlers.tid index 4a54872f0..d03be08aa 100644 --- a/editions/tw5.com/tiddlers/concepts/DataTiddlers.tid +++ b/editions/tw5.com/tiddlers/concepts/DataTiddlers.tid @@ -3,46 +3,29 @@ modified: 201308291647 tags: Concepts title: DataTiddlers -Data tiddlers provide a way to access blocks of [[JSON]] data within the `text` field of a tiddler. +A data tiddler is a miniature database contained within a tiddler. -//The implementation of data tiddlers is preliminary, with some intentional limitations.// +There are two standard formats: -! Data tiddler format +* DictionaryTiddlers +* [[JSONTiddlers]] -A native data tiddler must have: +Other formats of tiddler can also be parsed to yield blocks of data that behave like data tiddlers. -* The ContentType field `type` set to `application/json` -* Valid JSON data in the `text` field - -For example, the [[history list|$:/HistoryList]] tiddler is a data tiddler. - -Other tiddler types with alternative formats can also be parsed to yield a block of data that behaves like a data tiddler. - -!! Tiddler dictionary format - -The tiddler dictionary format is an alternative syntax for data tiddlers: - -* The ContentType field `type` is set to `application/x-tiddler-dictionary` -* The `text` field consists of one or more lines of the form `:` - -For example, palettes such as the [[default Vanilla palette|$:/palettes/Vanilla]] are tiddler dictionaries. - -! Accessing data within data tiddlers - -Currently, it is only possible to access the top level properties of the data using TextReference syntax. - -For example, given a `application/json` tiddler containing: +Use a TextReference to look up a value by its name. For example, if a [[DictionaryTiddler|DictionaryTiddlers]] called `MonthDays` contains: ``` -{"a":"one","b":"two","c":"three"} +oct:31 +nov:30 +dec:31 ``` -Or the equivalent tiddler dictionary of type `application/x-tiddler-dictionary`: +... then `{{MonthDays##nov}}` will resolve to the value `30`. + +The same is true if `MonthDays` is a [[JSONTiddler|JSONTiddlers]] with the following content: ``` -a:one -b:two -c:three +{"oct":31,"nov":30,"dec":31} ``` -With either of those definitions `{{TiddlerTitle##b}}` would have the value `two`. +Note: //It is currently only possible to retrieve data from the immediate properties of the root object of a JSONTiddler.// From 9aafed511bf5173be18a9d96f695838347f685be Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Sun, 28 Dec 2014 09:53:58 +0000 Subject: [PATCH 4/6] Add concept of Dictionary Tiddlers --- .../tw5.com/tiddlers/concepts/DictionaryTiddlers.tid | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 editions/tw5.com/tiddlers/concepts/DictionaryTiddlers.tid diff --git a/editions/tw5.com/tiddlers/concepts/DictionaryTiddlers.tid b/editions/tw5.com/tiddlers/concepts/DictionaryTiddlers.tid new file mode 100644 index 000000000..f9d9afe8d --- /dev/null +++ b/editions/tw5.com/tiddlers/concepts/DictionaryTiddlers.tid @@ -0,0 +1,12 @@ +created: 20141228094500000 +modified: 20141228094500000 +tags: Concepts +title: DictionaryTiddlers + +A dictionary tiddler is a [[data tiddler|DataTiddlers]] containing a simple list of name/value pairs. + +Its [[ContentType]] is `application/x-tiddler-dictionary`. + +The `text` field consists of one or more lines of the form //name//: //value//. + +[[ColourPalettes]], such as the [[default Vanilla palette|$:/palettes/Vanilla]], are dictionary tiddlers. From 4f1d6f71fcb899c99705e8b3664625141b96af07 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Sun, 28 Dec 2014 09:54:44 +0000 Subject: [PATCH 5/6] Add concept of JSON Tiddlers --- editions/tw5.com/tiddlers/concepts/JSONTiddlers.tid | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 editions/tw5.com/tiddlers/concepts/JSONTiddlers.tid diff --git a/editions/tw5.com/tiddlers/concepts/JSONTiddlers.tid b/editions/tw5.com/tiddlers/concepts/JSONTiddlers.tid new file mode 100644 index 000000000..776c77940 --- /dev/null +++ b/editions/tw5.com/tiddlers/concepts/JSONTiddlers.tid @@ -0,0 +1,10 @@ +created: 20141228094500000 +modified: 20141228094500000 +tags: Concepts +title: JSONTiddlers + +A JSON tiddler is a [[data tiddler|DataTiddlers]] containing a [[JSON]] structure in its `text` field. + +Its [[ContentType]] is `application/json`. + +The [[history list|$:/HistoryList]] is a good example of a JSON tiddler. From 79a3beeaa605d3245808751b184653aa41bac47f Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Sun, 28 Dec 2014 09:55:36 +0000 Subject: [PATCH 6/6] Add concept of Tag Tiddlers --- editions/tw5.com/tiddlers/concepts/TagTiddlers.tid | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 editions/tw5.com/tiddlers/concepts/TagTiddlers.tid diff --git a/editions/tw5.com/tiddlers/concepts/TagTiddlers.tid b/editions/tw5.com/tiddlers/concepts/TagTiddlers.tid new file mode 100644 index 000000000..1f6d45ecb --- /dev/null +++ b/editions/tw5.com/tiddlers/concepts/TagTiddlers.tid @@ -0,0 +1,10 @@ +created: 20141228094500000 +modified: 20141228094500000 +tags: Concepts +title: TagTiddlers + +A tag tiddler is any tiddler that is in use as a tag. + +The ''Tagging'' tab on the InfoPanel of a tag tiddler shows which tiddlers are tagged with the tag tiddler. + +A tag can be used without a corresponding tag tiddler.