Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
created: 20211127084727217
modified: 20211204120054422
tags: [[Customise TiddlyWiki]]
title: Customising TiddlyWiki's user interface
type: text/vnd.tiddlywiki

TiddlyWiki’s user interface is designed to be highly extensible. Every element can be augmented, removed, or rearranged.

Several different mechanisms are used to achieve this:

* special fields
* special titles
* special tags
* cascades

Here we provide an overview of those mechanisms and how they relate together.

!! Special Fields

Special fields are used to assign an appearance or behaviour to individual tiddlers. They can be thought of as flags or values that directly control the tiddler to which they are applied.

For example:

* Set the `icon` field to the title of an image tiddler to be used as the icon for this tiddler
* Set the `color` field to a CSS colour that is then used for icons and tag pills associated with this tiddler
* Set the `hide-body` field to `yes` to hide the view template body for this tiddler

See TiddlerFields for details of all the special fields.

!! Special Titles

Certain special titles identify configuration tiddlers that customise TiddlyWiki's appearance or behaviour. They can be thought of as global settings that affect an entire wiki.

For example:

* $:/DefaultTiddlers is a filter yielding the titles of the tiddlers that should be displayed at startup
* $:/SiteTitle specifies the text of the wiki title
* $:/config/Tags/MinLength controls the minimum number of characters to trigger tag autocompletion

Many of TiddlyWiki's configuration tiddlers are presented as options in [[$:/ControlPanel]]. Less commonly used configuration tiddlers do not have a user interface, but are documented in [[Hidden Settings]].

!! Special Tags

Special tags assign special behaviour or appearance to all of the tiddlers to which they are applied. They can be thought of as establishing ordered lists of tiddlers that are processed or displayed in a particular way.

For example:

* $:/tags/Macro causes the macros defined in a tiddler to be available globally
* $:/tags/Stylesheet causes the tiddler to be interpreted as a CSS stylesheet
* $:/tags/SideBar causes the tiddler to be displayed as a sidebar tab

See SystemTags for details of all the special tags.

The entire TiddlyWiki user interface is constructed from lists formed from special system tags.

The ordering of these lists is determined by the [[order of tagged tiddlers|Order of Tagged Tiddlers]] rules. Users can re-order tags using drag and drop within a tag dropdown.

!! Cascades

Cascades provide a means to select one of multiple values based on flexible, extensible criteria. They can be thought of as a list of conditions that are evaluated in turn until one of them matches.

For example, the core uses the template $:/core/ui/ViewTemplate to display tiddlers in view mode, and $:/core/ui/EditTemplate to display tiddlers in edit mode. A cascade is used to choose which template to use for a particular tiddler:

# If the tiddler is a draft, then use $:/core/ui/EditTemplate
# Otherwise, use $:/core/ui/EditTemplate

The list of conditions is defined via a special tag, making it possible to insert additional conditions anywhere in the list.

For example, a plugin might add a special template $:/plugins/example/map-template for tiddlers that have the tag [[$:/tags/Map]] by inserting an additional rule:

# If the tiddler is a draft, then use $:/core/ui/EditTemplate
# @@background: yellow; If the tiddler is tagged $:/tags/Map, then use $:/plugins/example/map-template@@
# Otherwise, use $:/core/ui/EditTemplate

See [[Cascades]] for more details.

This file was deleted.

5 changes: 3 additions & 2 deletions editions/tw5.com/tiddlers/definitions/BT.tid
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
created: 201311010911
modified: 201311010911
created: 20131101091100000
modified: 20211117195517318
tags: Definitions
title: BT

BT (née British Telecom) is the UK's largest telecommunications company. In 2007, [[Osmosoft]] was acquired by BT. JeremyRuston subsequently left BT in 2011.
4 changes: 2 additions & 2 deletions editions/tw5.com/tiddlers/definitions/MathML.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20130901213100000
modified: 20140919161635814
tags: Definitions Features
modified: 20211124215351987
tags: Definitions
title: MathML
type: text/vnd.tiddlywiki

Expand Down
5 changes: 3 additions & 2 deletions editions/tw5.com/tiddlers/definitions/Osmosoft.tid
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
created: 201311010913
modified: 201311010924
created: 20131101091300000
modified: 20211119004632506
tags: Definitions
title: Osmosoft

Founded in 2004 by JeremyRuston, Osmosoft was originally a consultancy for software services around TiddlyWiki. Notable engagements included working with Socialtext on [[Socialtext Unplugged|https://www.socialtext.net/open/socialtext_unplugged]].
Expand Down
3 changes: 2 additions & 1 deletion editions/tw5.com/tiddlers/definitions/node-webkit.tid
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
created: 20140101164042231
modified: 20150310165059118
modified: 20211120221754270
tags: Definitions
title: node-webkit
type: text/vnd.tiddlywiki

Expand Down
3,711 changes: 4 additions & 3,707 deletions editions/tw5.com/tiddlers/demonstrations/Alice in Wonderland.tid

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions editions/tw5.com/tiddlers/demonstrations/Apple.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20180222072026299
list: [[Apple 6]] [[Apple 7]] [[Apple 8]] [[Apple 9]] [[Apple 10]] [[Apple 20]] [[Apple 30]] [[Apple 100]]
modified: 20180222072215582
tags:
modified: 20211115005421558
tags: Demonstrations
title: Apple

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
title: Caruso - Ave Maria
type: audio/mp3
_canonical_uri: https://archive.org/download/Caruso_part1/Caruso-AveMaria.mp3
tags: Demonstrations
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
created: 20211204122107920
filter: HelloThere Community GettingStarted Features Reference Plugins Learning
modified: 20211204131610322
tags: $:/tags/TiddlerList
title: Demo Tiddler List with Custom Story Tiddler Template
type: text/vnd.tiddlywiki

This is a demo tiddler with a custom story tiddler template that displays the tiddlers named in the list field as a fan.

See [[How to create a custom story tiddler template]] for details.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
title: $:/_tw5.com/CustomStoryTiddlerTemplateDemo/Styles
tags: $:/tags/Stylesheet

.tc-custom-tiddler-template {
border: 3px solid <<colour muted-foreground>>;
border-radius: 1em;
margin-bottom: 1em;
}

.tc-custom-tiddler-template-inner {
background: <<colour muted-foreground>>;
padding: 1em;
}

.tc-custom-tiddler-template-list {
position: relative;
height: 33vh;
}

.tc-custom-tiddler-template-list .tc-custom-tiddler-template-list-item {
position: absolute;
width: 100%;
transform-origin: 50% 0;
top: 50px;
left: 0;
<<box-shadow "0px 0px 15px rgba(0, 0, 0, 0.3)">>
}

.tc-custom-tiddler-template-list .tc-custom-tiddler-template-list-item .tc-tiddler-frame {
margin: 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
title: $:/_tw5.com/CustomStoryTiddlerTemplateDemo/Template

\define list-item-styles()
transform: translate($(left)$%,$(top)$%) scale(0.3) rotate($(angle)$deg);
\end

<div class="tc-custom-tiddler-template">
<div class="tc-custom-tiddler-template-inner">
<div style="text-align: right;">
{{||$:/core/ui/Buttons/more-tiddler-actions}} {{||$:/core/ui/Buttons/edit}} {{||$:/core/ui/Buttons/close}}
</div>
<$transclude mode="block"/>
</div>
<div class="tc-custom-tiddler-template-list">
<$let numItems={{{ [subfilter{!!filter}count[]] }}} angleIncrement={{{ [[45]divide<numItems>] }}} posIncrement={{{ [[90]divide<numItems>] }}}>
<$list filter={{!!filter}} counter="counter">
<$let angle={{{ [<counter>subtract[1]multiply<angleIncrement>subtract[22.5]] }}} left={{{ [<counter>subtract[1]multiply<posIncrement>subtract[45]] }}} top={{{ 0 }}}>
<div class="tc-custom-tiddler-template-list-item" style=<<list-item-styles>>>
{{||$:/core/ui/ViewTemplate}}
</div>
</$let>
</$list>
</$let>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
title: $:/_tw5.com/CustomStoryTiddlerTemplateDemo/Filter
tags: $:/tags/StoryTiddlerTemplateFilter
list-before: $:/config/StoryTiddlerTemplateFilters/default

[tag[$:/tags/TiddlerList]then[$:/_tw5.com/CustomStoryTiddlerTemplateDemo/Template]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
created: 20211206114433294
list-before: $:/config/TiddlerColourFilters/default
modified: 20211206114433294
tags: $:/tags/TiddlerColourFilter
title: $:/_tw5.com/CustomTiddlerColourCascadeDemo
type: text/vnd.tiddlywiki

[tag[TableOfContents]then[#1e90ff]]
[tag[Working with TiddlyWiki]then[darkorchid]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
created: 20211205195110592
list-before: $:/config/TiddlerIconFilters/default
modified: 20211205195217941
tags: $:/tags/TiddlerIconFilter
title: $:/_tw5.com/CustomTiddlerIconCascadeDemo
type: text/vnd.tiddlywiki

[tag[TableOfContents]then[$:/core/images/globe]]
[tag[Working with TiddlyWiki]then[$:/core/images/help]]
21 changes: 5 additions & 16 deletions editions/tw5.com/tiddlers/demonstrations/ImageGallery Example.tid
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
created: 20140809113603449
modified: 20150520161451179
modified: 20211022195248529
tags: Learning
title: ImageGallery Example
type: text/vnd.tiddlywiki

Here is an example of using the ListWidget and the TranscludeWidget to show a grid of all system images (ie, tiddlers tagged [[$:/tags/Image]]).
<<.warning "The [[ImageGallery Example]] has been replaced with the new [[Icon Gallery]] which is transcluded below">>

<style>
.my-gallery svg {
width: 6em;
height: 6em;
margin: 1em;
}
</style>
<div class="my-gallery">
<$list filter="[all[tiddlers+shadows]tag[$:/tags/Image]]">
<span title=<<currentTiddler>>>
<$transclude/>
</span>
</$list>
</div>
---

{{Icon Gallery}}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20210222140234737
modified: 20210520174049056
tags: Learning
modified: 20211123034501278
tags: Learning KeyboardDrivenInput
title: Demonstration: keyboard-driven-input Macro
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
created: 20210131043724146
first-search-filter: [!is[system]search:title<userInput>sort[]]
modified: 20210204012422020
tags:
modified: 20211123034440629
tags: KeyboardDrivenInput
title: kdi-demo-configtid
type: text/vnd.tiddlywiki
type: text/vnd.tiddlywiki

9 changes: 0 additions & 9 deletions editions/tw5.com/tiddlers/demonstrations/SampleAlert.tid

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
created: 20140912145543340
modified: 20140912145610020
modified: 20211119192337845
tags: Demonstrations
title: SampleNotification
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
created: 20211117003509226
modified: 20211117003657902
tags: sampletag1 sampletag2 [[Widget Examples]]
title: SampleTiddlerFirst
tags: sampletag1 sampletag2

This is a test tiddler called SampleTiddlerFirst.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
created: 20211117003511221
modified: 20211117003724108
tags: sampletag1 sampletag2 [[Widget Examples]]
title: SampleTiddlerSecond
tags: sampletag1 sampletag2

This test tiddler is called SampleTiddlerSecond.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
created: 20211117003513463
modified: 20211117003749750
tags: sampletag1 sampletag2 [[Widget Examples]]
title: SampleTiddlerThird
tags: sampletag1 sampletag2

This tiddler SampleTiddlerThird is the third test tiddler.
3 changes: 2 additions & 1 deletion editions/tw5.com/tiddlers/demonstrations/SampleWizard.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
created: 20140912145537860
footer: <$button message="tm-close-tiddler">Close</$button>
modified: 20210627054504823
modified: 20211119205125230
subtitle: I'm a modal wizard
tags: Demonstrations
title: SampleWizard
type: text/vnd.tiddlywiki

Expand Down
3 changes: 2 additions & 1 deletion editions/tw5.com/tiddlers/demonstrations/SampleWizard2.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
created: 20140912145532856
footer: <$button message="tm-close-tiddler">Close</$button>
modified: 20140912145532856
modified: 20211119205144340
subtitle: I'm another modal wizard
tags: Demonstrations
title: SampleWizard2
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
created: 20150221194324000
modified: 20150221194606000
title: Contents
list: First Second Third Fourth
modified: 20211114013601186
tags: [[Table-of-Contents Demonstrations]]
title: Contents

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
created: 20150221194349000
modified: 20150221194610000
title: First
tags: Contents
list: FirstOne FirstTwo FirstThree
modified: 20211114013601187
tags: Contents [[Table-of-Contents Demonstrations]]
title: First

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20150221194354000
modified: 20150221194613000
modified: 20211114013601187
tags: First [[Table-of-Contents Demonstrations]]
title: FirstOne
tags: First

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20150221194357000
modified: 20150221194616000
modified: 20211114013601187
tags: First [[Table-of-Contents Demonstrations]]
title: FirstThree
tags: First

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20150221194401000
modified: 20150221194619000
modified: 20211114013601187
tags: First [[Table-of-Contents Demonstrations]]
title: FirstTwo
tags: First

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20150221194405000
modified: 20150221194622000
modified: 20211114013601188
tags: Contents [[Table-of-Contents Demonstrations]]
title: Fourth
tags: Contents

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20150221194408000
modified: 20150221194624000
modified: 20211114013601190
tags: Contents [[Table-of-Contents Demonstrations]]
title: Second
tags: Contents

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20150221194412000
modified: 20150221194627000
modified: 20211114013601188
tags: Second [[Table-of-Contents Demonstrations]]
title: SecondOne
tags: Second

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
created: 20150221194416000
modified: 20150221194630000
title: SecondThree
tags: Second
list: SecondThreeOne SecondThreeTwo SecondThreeThree
modified: 20211114013601189
tags: Second [[Table-of-Contents Demonstrations]]
title: SecondThree
toc-link: no

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20150221194420000
modified: 20150221194633000
modified: 20211114013601188
tags: SecondThree [[Table-of-Contents Demonstrations]]
title: SecondThreeOne
tags: SecondThree

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20150221194423000
modified: 20150221194635000
modified: 20211114013601189
tags: SecondThree [[Table-of-Contents Demonstrations]]
title: SecondThreeThree
tags: SecondThree

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20150221194429000
modified: 20150221194638000
modified: 20211114013601189
tags: SecondThree [[Table-of-Contents Demonstrations]]
title: SecondThreeTwo
tags: SecondThree

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20150221194433000
modified: 20150221194643000
modified: 20211114013601190
tags: Second [[Table-of-Contents Demonstrations]]
title: SecondTwo
tags: Second

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
created: 20150221194436000
modified: 20150221194646000
title: Third
tags: Contents
list: ThirdOne ThirdTwo ThirdThree
modified: 20211114013601191
tags: Contents [[Table-of-Contents Demonstrations]]
title: Third

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20150221194440000
modified: 20150221194649000
modified: 20211114013601190
tags: Third [[Table-of-Contents Demonstrations]]
title: ThirdOne
tags: Third

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20150221194446000
modified: 20150221194652000
modified: 20211114013601190
tags: Third [[Table-of-Contents Demonstrations]]
title: ThirdThree
tags: Third

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20150221194453000
modified: 20150221194655000
modified: 20211114013601191
tags: Third [[Table-of-Contents Demonstrations]]
title: ThirdTwo
tags: Third

<<.toc-lorem>>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
created: 20150221230034000
modified: 20211116034929868
tags: [[tag Macro (Examples)]] [[Macro Examples]]
title: Example for tag Macro
tags: [[tag Macro (Examples)]]

This tiddler exists to demonstrate the <<.mlink tag>> macro.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 201308251430
modified: 201308251430
tags: task
created: 20130825143000000
modified: 20211115013141494
tags: task TaskManagementExample
title: Compose ballad

//This is a sample task for the TaskManagementExample//
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 201308251431
modified: 201308251431
tags: task
created: 20130825143100000
modified: 20211115013240401
tags: task TaskManagementExample
title: Get the Ring

//This is a sample task for the TaskManagementExample//
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 201308251431
modified: 201308251431
tags: task done
created: 20130825143100000
modified: 20211115181040966
tags: task done TaskManagementExample
title: Go to Mordor

//This is a sample task for the TaskManagementExample//
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
created: 201308251431
modified: 20150124131347000
tags: task
title: Kill the Dragon
created: 20130825143100000
list-before: Get the Ring
modified: 20211115013217852
tags: task TaskManagementExample
title: Kill the Dragon

//This is a sample task for the TaskManagementExample//
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 201308251431
modified: 201308251431
tags: task
created: 20130825143100000
modified: 20211115013200231
tags: task TaskManagementExample
title: Make the beds

//This is a sample task for the TaskManagementExample//
4 changes: 3 additions & 1 deletion editions/tw5.com/tiddlers/demonstrations/Tasks/done.tid
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
color: #2dbe37
created: 20211115013354157
icon: $:/core/images/done-button
modified: 201307051027
modified: 20211115013357660
tags: TaskManagementExample
title: done

5 changes: 3 additions & 2 deletions editions/tw5.com/tiddlers/demonstrations/Tasks/task.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
color: #8d9ac3
created: 201308252132
created: 20130825213200000
list: [[Make the beds]]
modified: 201606011653
modified: 20211115013121643
tags: TaskManagementExample
title: task

//This tag identifies the tasks for the TaskManagementExample//
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
created: 20150117192110000
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
modified: 20211116221246915
my-special-list: [[listed Operator (Examples)]]
short: Mon Tue Wed Thu Fri Sat Sun
tags: [[Operator Examples]]
title: Days of the Week
type: text/vnd.tiddlywiki

<<.this-is-operator-example>>

Expand Down
3 changes: 2 additions & 1 deletion editions/tw5.com/tiddlers/demonstrations/Weekdays/Friday.tid
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
created: 20150117192111000
modified: 20150118131534000
modified: 20211116221111294
tags: [[Operator Examples]]
title: Friday
type: text/vnd.tiddlywiki

Expand Down
3 changes: 2 additions & 1 deletion editions/tw5.com/tiddlers/demonstrations/Weekdays/Monday.tid
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
created: 20150117192113000
modified: 20150118131645000
modified: 20211116221111294
tags: [[Operator Examples]]
title: Monday
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
created: 20151620490000000
modified: 20150118131537000
created: 20150422010000000
modified: 20211116221111294
tags: [[Operator Examples]]
title: Saturday
type: text/vnd.tiddlywiki

Expand Down
3 changes: 2 additions & 1 deletion editions/tw5.com/tiddlers/demonstrations/Weekdays/Sunday.tid
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
created: 20150117192115000
modified: 20150118131539000
modified: 20211116220736572
tags: [[Operator Examples]]
title: Sunday
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
created: 20150117192116000
modified: 20150124204253000
modified: 20211116221111295
tags: [[Operator Examples]]
title: Thursday
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
created: 20150117192118000
modified: 20150118131558000
modified: 20211116221111295
tags: [[Operator Examples]]
title: Tuesday
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
created: 20150117192119000
modified: 20150118131707000
modified: 20211116221111295
tags: [[Operator Examples]]
title: Wednesday
type: text/vnd.tiddlywiki

Expand Down
3 changes: 3 additions & 0 deletions editions/tw5.com/tiddlers/demonstrations/sampletag1.tid
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
created: 20211117214646420
modified: 20211117214650773
tags: [[Widget Examples]]
title: sampletag1

This is `sampletag1`.
3 changes: 3 additions & 0 deletions editions/tw5.com/tiddlers/demonstrations/sampletag2.tid
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
created: 20211117214707647
modified: 20211117214716137
tags: [[Widget Examples]]
title: sampletag2

This is `sampletag2`.
8 changes: 7 additions & 1 deletion editions/tw5.com/tiddlers/features/DateFormat.tid
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ tags: Features
title: DateFormat
type: text/vnd.tiddlywiki

When used to display date values (with the `format` attribute set to ''date''), the ViewWidget accepts a `template` attribute that allows the format of the date values to be specified. The format string is processed with the following substitutions:
The default representation of dates is a compact string such as `20211002153802059`. For example, the `created` and `modified` fields are stored like this.

The display format for this string can be controlled with a template. For example, transcluding the `modified` field automatically applies a template to display the date as `Sat Oct 02 2021 17:40:50 GMT+0200 (Central European Summer Time)`. A few widgets and filter operators allow you to manually specify a template, for example the ViewWidget:

`<$view field=modified format=date template=“DDth mmm YYYY 0hh:0mm:0ss” />`

The date string is processed with the following substitutions:

|!Token |!Substituted Value |
|`ddddd` |<<.from-version "5.2.0">> Day of year (1 to 365, or 366 for leap years) |
Expand Down
5 changes: 2 additions & 3 deletions editions/tw5.com/tiddlers/features/LazyLoading.tid
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
created: 20140206214608586
modified: 20180701185417525
modified: 20211009145417525
tags: Features
title: LazyLoading
type: text/vnd.tiddlywiki
Expand All @@ -11,7 +11,7 @@ Lazy loading can be used in two configurations:
* When running [[TiddlyWiki on Node.js]], just image tiddlers or all non-system tiddlers can be subject to lazy loading
* When running [[TiddlyWiki in the Sky for TiddlyWeb]], all tiddlers are subject to lazy loading

See the LazyLoadingMechanism for details of how lazy loading is implemented.
See the [[Lazy Loading Mechanism|https://tiddlywiki.com/dev/#LazyLoadingMechanism]] for details of how lazy loading is implemented.

! Lazy loading under Node.js

Expand All @@ -28,4 +28,3 @@ To apply lazy loading to all non-system tiddlers use this command:
```
tiddlywiki --listen root-tiddler=$:/core/save/lazy-all
```

6 changes: 4 additions & 2 deletions editions/tw5.com/tiddlers/features/Scalability.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
created: 20130822173400000
modified: 20140912145800365
modified: 20211124215615812
tags: Features
title: Scalability
type: text/vnd.tiddlywiki

You might expect that TiddlyWiki's architecture as a SinglePageApplication would make it unsuitable for large amounts of data. In fact, TiddlyWiki users regularly work with files that are 20 or 30 megabytes without problems - and successful experiments have been done up into the gigabytes.
You might expect that TiddlyWiki's architecture as a SinglePageApplication would make it unsuitable for large amounts of data. In fact, TiddlyWiki users regularly work with files that are tens or even over a hundred megabytes without problems - and successful experiments have been done up into the gigabytes.

See [[performance tips|Performance]] for large wikis.
15 changes: 15 additions & 0 deletions editions/tw5.com/tiddlers/filters/acos Operator.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
caption: acos
created: 20211019211936842
modified: 20211021222835888
op-input: a [[selection of titles|Title Selection]]
op-output: the arccosine (in radians) of the input numbers
op-purpose: calculate the arccosine value (in radians) of a list of numbers
tags: [[Filter Operators]] [[Mathematics Operators]] [[Trigonometric Operators]] [[Unary Mathematics Operators]]
title: acos Operator
type: text/vnd.tiddlywiki

<<.from-version "5.1.21">> See [[Mathematics Operators]] for an overview.

<<.tip " This is the inverse operation of [[cos|cos Operator]]: cos calculate the cosine of an angle (in radian), but acos calculate the angle (in radian) of a cosine.">>

<<.operator-examples "acos">>
15 changes: 15 additions & 0 deletions editions/tw5.com/tiddlers/filters/asin Operator.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
caption: asin
created: 20211019212120548
modified: 20211021222841479
op-input: a [[selection of titles|Title Selection]]
op-output: the arcsine (in radians) of the input numbers
op-purpose: calculate the arcsine value (in radians) of a list of numbers
tags: [[Filter Operators]] [[Mathematics Operators]] [[Trigonometric Operators]] [[Unary Mathematics Operators]]
title: asin Operator
type: text/vnd.tiddlywiki

<<.from-version "5.1.21">> See [[Mathematics Operators]] for an overview.

<<.tip " This is the inverse operation of [[sin|sin Operator]]: sin calculate the sine of an angle (in radian), but asin calculate the angle (in radian) of a sine.">>

<<.operator-examples "asin">>
13 changes: 13 additions & 0 deletions editions/tw5.com/tiddlers/filters/atan Operator.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
caption: atan
created: 20211019211516128
modified: 20211021222847610
op-input: a [[selection of titles|Title Selection]]
op-output: the arctangent (in radians) of the input numbers
op-purpose: calculate the arctangent value (in radians) of a list of numbers
tags: [[Filter Operators]] [[Mathematics Operators]] [[Trigonometric Operators]] [[Unary Mathematics Operators]]
title: atan Operator
type: text/vnd.tiddlywiki

<<.from-version "5.1.21">> See [[Mathematics Operators]] for an overview.

<<.operator-examples "atan">>
15 changes: 15 additions & 0 deletions editions/tw5.com/tiddlers/filters/atan2 Operator.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
caption: atan2
created: 20211019222810994
modified: 20211021222853123
op-input: a [[selection of titles|Title Selection]] = coordinate Y (<<.place Y>>)
op-output: the angle in radians (in [ - π , π ] ) between the positive x-axis and the ray from (0,0) to the point (x,y)
op-parameter: coordinate X
op-parameter-name: X
op-purpose: returns the angle in the plane (in radians) between the positive x-axis and the ray from (0,0) to the point (x,y), for [<<.place Y>>]atan2[<<.place X>>]
tags: [[Filter Operators]] [[Mathematics Operators]] [[Binary Mathematics Operators]] [[Trigonometric Operators]]
title: atan2 Operator
type: text/vnd.tiddlywiki

<<.from-version "5.1.21">> See [[Mathematics Operators]] for an overview.

<<.operator-examples "atan2">>
13 changes: 13 additions & 0 deletions editions/tw5.com/tiddlers/filters/cos Operator.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
caption: cos
created: 20211019211007324
modified: 20211021222900121
op-input: a [[selection of titles|Title Selection]]
op-output: the cosine of the input angles (numeric value between -1 and 1)
op-purpose: calculate the cosine value of a list of angles (given in radians)
tags: [[Filter Operators]] [[Mathematics Operators]] [[Trigonometric Operators]] [[Unary Mathematics Operators]]
title: cos Operator
type: text/vnd.tiddlywiki

<<.from-version "5.1.21">> See [[Mathematics Operators]] for an overview.

<<.operator-examples "cos">>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ modified: 20210506130322593
op-input: ignored
op-output: the title of each available deserializer
op-parameter: none
tags: [[Filter Operators]] [[Special Operators]]
tags: [[Filter Operators]] [[Special Operators]] [[Selection Constructors]]
title: deserializers Operator
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ op-output: the titles stored as a [[title list|Title List]] in each input title
op-purpose: select titles by interpreting each input title as a [[title list|Title List]]
op-suffix: `dedupe` (the default) to remove duplicates, `raw` to leave duplicates untouched
op-suffix-name: D
tags: [[Filter Operators]] [[String Operators]] [[Selection Constructors]]
tags: [[Filter Operators]] [[String Operators]]
title: enlist-input Operator
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
created: 20211020142658214
modified: 20211020142724786
tags: [[acos Operator]] [[Operator Examples]]
title: acos Operator (Examples)

<<.operator-example 1 "[[2]acos[]]">>
<<.operator-example 2 "=1 =2 =3 =4 +[acos[]]">>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
created: 20211020142731829
modified: 20211020142758974
tags: [[Operator Examples]] [[asin Operator]]
title: asin Operator (Examples)

<<.operator-example 1 "[[2]asin[]]">>
<<.operator-example 2 "=1 =2 =3 =4 +[asin[]]">>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
created: 20211020141113826
modified: 20211020141329661
tags: [[atan2 Operator]] [[Operator Examples]]
title: atan Operator (Examples)

<<.operator-example 1 "[[2]atan[]]">>
<<.operator-example 2 "=1 =2 =3 =4 +[atan[]]">>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
created: 20211020140733724
modified: 20211020140827194
tags: [[atan2 Operator]] [[Operator Examples]]
title: atan2 Operator (Examples)

<<.operator-example 1 "[[2]atan2[5]]">>
<<.operator-example 2 "=1 =2 =3 =4 +[atan2[4]]">>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
created: 20211020142042072
modified: 20211020142110929
tags: [[Operator Examples]] [[cos Operator]]
title: cos Operator (Examples)

<<.operator-example 1 "[[2]cos[]]">>
<<.operator-example 2 "=1 =2 =3 =4 +[cos[]]">>
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Cycle through a list of values to add as a tag, in reverse order:

<<.using-days-of-week>>
<<.operator-example 1 """[list[Days of the Week]first[]] +[cycle{Days of the Week!!list}]""">>
<<.operator-example 1 """[list[Days of the Week]first[]] +[cycle{Days of the Week!!list},[2]]""">>
<<.operator-example 2 """[list[Days of the Week]first[]] +[cycle{Days of the Week!!list},[2]]""">>
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Logarithm of `100` with base `10`:
<<.operator-example 2 "[[100]log[10]]">>

Natural logarithm of 10 (base `e`), equivalent to `ln(10)` in mathematics:
<<.operator-example 2 "[[10]log[]]">>
<<.operator-example 3 "[[10]log[]]">>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
created: 20170907144257037
modified: 20170907144559822
modified: 20211118025451349
tags: [[Operator Examples]]
title: lookup Operator (Examples)
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ title: match Operator (Examples)
type: text/vnd.tiddlywiki

<<.operator-example 1 "a b c +[match[b]]">>
<<.operator-example 1 "[match[HelloThere]]">>
<<.operator-example 2 "[match[HelloThere]]">>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
created: 20201107112846692
modified: 20201118103305351
modified: 20211101125225197
tags: [[Operator Examples]] [[search-replace Operator]]
title: search-replace Operator (Examples)
type: text/vnd.tiddlywiki
Expand All @@ -25,8 +25,14 @@ You can also use regular expression capture groups in the replacement string:
`\define names() (\w+)\s(\w+)`
<<.operator-example 4 """[[John Smith]search-replace::regexp<names>,[$2,$1]]""" >>

You can reference the portion of the input that matches the regular expression with `$&`:
<<.operator-example 5 """[[John Smith]search-replace::regexp[John .*],[His name is $&]]""">>

<<.operator-example 6 """[[This is an exciting feature]search-replace::regexp[exciting],[amazing and $&]]""">>

To replace everything but a match using a regular expression and the ''multiline'' (m) flag:
`\define myregexp2() ^(?!Unlike).*$`
<<.operator-example 5 """[[HelloThere]get[text]search-replace:gm:regexp<myregexp2>,[]]""">>
<<.operator-example 7 """[[HelloThere]get[text]search-replace:gm:regexp<myregexp2>,[]]""">>


{{How to remove stop words}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
created: 20211020142121129
modified: 20211020142146276
tags: [[Operator Examples]] [[sin Operator]]
title: sin Operator (Examples)

<<.operator-example 1 "[[2]sin[]]">>
<<.operator-example 2 "=1 =2 =3 =4 +[sin[]]">>
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
created: 20181031175129475
modified: 20181031175129475
modified: 20211030223407188
tags: [[subfilter Operator]] [[Operator Examples]]
title: subfilter Operator (Examples)
type: text/vnd.tiddlywiki

<<.operator-example 1 "[subfilter[one two three]addsuffix[!]]">>
<<.operator-example 2 "[subfilter{$:/StoryList!!list}]">>
\define recent-mods() [has[modified]!sort[modified]limit[5]]
\define display-variable(name)
''<$text text=<<__name__>>/>'': <code><$text text={{{ [<__name__>getvariable[]] }}}/></code>
\end

Literal filter operands can be used, but such cases are better rewritten without using <<.op subfilter>>:
<<.operator-example 1 "[subfilter[one two three]addsuffix[!]]" "same as `one two three +[addsuffix[!]]`">>

The <<.op subfilter>> operator can be used to dynamically define parts of a [[filter run|Filter Run]]. This is useful for sharing a common pieces of a filter across multiple filters.

For example, this variable:

* <<display-variable recent-mods>>

can be used in one filter like this:

<<.operator-example 2 "[tag[Filter Operators]subfilter<recent-mods>addsuffix[!]]" "same as `[tag[Filter Operators]has[modified]!sort[modified]limit[5]addsuffix[!]]`">>

and in another similar filter like this:
<<.operator-example 3 "[tag[ActionWidgets]subfilter<recent-mods>addprefix[!]]">>

Variables are not the only way to define dynamic subfilters. [[Text references|TextReference]] can be used to load a subfilter from a tiddler field (see also [[Filter Parameter]]):
<<.operator-example 4 "[subfilter{$:/StoryList!!list}limit[5]]">>
<<.operator-example 5 "[subfilter{$:/StoryList!!list}subfilter<recent-mods>]">>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
created: 20211020142158187
modified: 20211020142222782
tags: [[Operator Examples]] [[tan Operator]]
title: tan Operator (Examples)

<<.operator-example 1 "[[2]tan[]]">>
<<.operator-example 2 "=1 =2 =3 =4 +[tan[]]">>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
created: 20211029023246203
modified: 20211029023559616
tags: [[Operator Examples]] [[zth Operator]]
title: zth Operator (Examples)
type: text/vnd.tiddlywiki

<<.using-days-of-week>>

<<.operator-example 1 "[list[Days of the Week]zth[]]">>
<<.operator-example 2 "[list[Days of the Week]zth[5]]">>
4 changes: 2 additions & 2 deletions editions/tw5.com/tiddlers/filters/list.tid
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
created: 20140410103123179
modified: 20150220161020000
modified: 20211115092315020
tags: [[Filter Operators]] [[Field Operators]] [[Selection Constructors]] [[Negatable Operators]]
title: list Operator
type: text/vnd.tiddlywiki
Expand All @@ -14,7 +14,7 @@ op-neg-output: those input titles that are <<.em not>> mentioned at <<.place R>>

<<.place R>> can reference either a field or a property. See [[TextReference]] for the syntax.

* 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 neither is specified, the <<.field list>> field is used by default. So `[list[T]]` outputs the titles listed in the <<.field list>> field of tiddler T.
* If <<.place R>> consists of <<.em only>> a field or a property, the tiddler part of the reference defaults to the [[current tiddler|Current Tiddler]]. So `[list[!!tags]]` outputs the titles listed in the <<.field tags>> field of the current tiddler.

<<.operator-examples "list">>
16 changes: 9 additions & 7 deletions editions/tw5.com/tiddlers/filters/nth.tid
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
created: 20150122204111000
modified: 20150203192048000
tags: [[Filter Operators]] [[Order Operators]]
title: nth Operator
type: text/vnd.tiddlywiki
caption: nth
op-purpose: select the <<.place N>>th input title
created: 20150122204111000
modified: 20211029023739450
op-input: a [[selection of titles|Title Selection]]
op-output: the <<.place N>>th input title
op-parameter: an integer, defaulting to 1
op-parameter-name: N
op-output: the <<.place N>>th input title
op-purpose: select the <<.place N>>th input title
tags: [[Filter Operators]] [[Order Operators]]
title: nth Operator
type: text/vnd.tiddlywiki

<<.place N>> is one-based. In other words, `nth[1]` has the same effect as the <<.olink first>> operator.

<<.tip "See <<.olink zth>> for an equivalent operator with a 0 based parameter">>

<<.operator-examples "nth">>
2 changes: 1 addition & 1 deletion editions/tw5.com/tiddlers/filters/range.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20171221184734665
modified: 20210907170339891
tags: [[Filter Operators]] [[Negatable Operators]]
tags: [[Filter Operators]] [[Negatable Operators]] [[Selection Constructors]]
title: range Operator
type: text/vnd.tiddlywiki
caption: range
Expand Down
13 changes: 13 additions & 0 deletions editions/tw5.com/tiddlers/filters/sin Operator.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
caption: sin
created: 20211019203650938
modified: 20211021222816944
op-input: a [[selection of titles|Title Selection]]
op-output: the sine of the input angles (numeric value between -1 and 1)
op-purpose: calculate the sine value of a list of angles (given in radians)
tags: [[Filter Operators]] [[Mathematics Operators]] [[Trigonometric Operators]] [[Unary Mathematics Operators]]
title: sin Operator
type: text/vnd.tiddlywiki

<<.from-version "5.1.21">> See [[Mathematics Operators]] for an overview.

<<.operator-examples "sin">>
2 changes: 1 addition & 1 deletion editions/tw5.com/tiddlers/filters/storyviews.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20150126141718000
modified: 20150203191420000
tags: [[Filter Operators]] [[Special Operators]]
tags: [[Filter Operators]] [[Special Operators]] [[Selection Constructors]]
title: storyviews Operator
type: text/vnd.tiddlywiki
caption: storyviews
Expand Down
6 changes: 4 additions & 2 deletions editions/tw5.com/tiddlers/filters/subfilter Operator.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
caption: subfilter
created: 20181031175129475
modified: 20181031175129475
modified: 20211030223407188
op-input: a [[selection of titles|Title Selection]] passed as input to the subfilter
op-neg-input: a [[selection of titles|Title Selection]] passed as input to the subfilter
op-neg-output: those input titles that are <<.em not>> returned from the subfilter <<.place S>>
Expand All @@ -12,7 +12,7 @@ tags: [[Filter Operators]] [[Field Operators]] [[Selection Constructors]] [[Nega
title: subfilter Operator
type: text/vnd.tiddlywiki

<<.from-version "5.1.18">> Note that the subfilter operator was introduced in version 5.1.18 and is not available in earlier versions.
<<.from-version "5.1.18">> Note that the <<.op subfilter>> operator was introduced in version 5.1.18 and is not available in earlier versions.

<<.tip " Literal filter operands cannot contain square brackets but you can work around the issue by using a variable:">>

Expand All @@ -24,4 +24,6 @@ type: text/vnd.tiddlywiki

<<.tip "Compare with the similar [[filter|filter Operator]] operator which runs a subfilter against each title, returning those titles that return a non-empty list (and discards the results of the subfilter)">>

The <<.op subfilter>> operator will act as a [[constructor|Selection Constructors]] whenever the filter defined by its operand is a [[constructor|Selection Constructors]]. Otherwise, it will act as a [[modifier|Selection Constructors]].

<<.operator-examples "subfilter">>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
created: 20211130114857532
filter1: [prefix[ca]then[ca]]
filter2: [suffix[at]then[at]]
filter3: other
modified: 20211204010918504
tags: [[Filter Run Prefix Examples]] [[Filter Syntax]] [[Cascade Filter Run Prefix]]
title: Cascade Filter Run Prefix (Examples)
type: text/vnd.tiddlywiki

The <<.op ":cascade">> filter run prefix is used by the ~TiddlyWiki core to choose the colour for each tiddler as used in the tag pill generated by the tag macro.

`:cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]]`

The filter expression inside the above <<.op :cascade>> filter run returns a list of filters from the text fields of tiddlers tagged <<tag $:/tags/TiddlerColourFilter>> as shown below:

<ul>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]]">
<li><pre><$text text=<<currentTiddler>>/></pre></li>
</$list>
</ul>

For each input title, each of these filters is now applied to in turn until the first filter that returns a non-empty list. The first result from this non-empty list replaces that input title and is used as the colour for that tiddler.

<<.operator-example 1 """[all[shadows+tiddlers]] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] +[!is[blank]limit[10]]""">>

!! Extended example

This example illustrates step-by-step how the <<.op :cascade>> filter run works.

A filter expression whose output returns a list of filters is required. Typically such a filter expression will construct the list of filters by querying some field in a set of tiddlers (likely via tag). To keep this example self-contained, 3 filters are stored in the //filter1//, //filter2// and //filter3// fields of this tiddler. [[Text references|TextReference]] and instances of the [[append operator|append Operator]] are used to combine the fields into a list of filters.

The filter `[{!!filter1}append{!!filter2}append{!!filter3}]`, generates this list of filters:

<ul>
<$list filter="[{!!filter1}append{!!filter2}append{!!filter3}]">
<li><pre><$text text=<<currentTiddler>>/></pre></li>
</$list>
</ul>

For this example, `cat can bat bug` will be used as the input titles. Each input title will be evaluated by <<.op :cascade>> against each of the above filters in turn. To help understand what <<.op :cascade>> sees internally, the following table uses the [[Map Filter Run Prefix]] to show the result of each individual filter.

|^<<.operator-example c1.1 "cat can bat bug :map[prefix[ca]then[ca]]">>|^<<.operator-example c1.2 "cat can bat bug :map[suffix[at]then[at]]">>|^<<.operator-example c1.3 "cat can bat bug :map[[other]]">>|

Click "Try it" on the above 3 examples. The first non-blank value from each row as read from left to right will be returned when <<.op :cascade>> is used. Click "Try it" below to see the final result:

<<.operator-example c1.4 "cat can bat bug :cascade[{!!filter1}append{!!filter2}append{!!filter3}]">>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
created: 20211130114043280
modified: 20211130121544118
tags: [[Filter Syntax]] [[Filter Run Prefix]]
title: Cascade Filter Run Prefix
type: text/vnd.tiddlywiki

<<.from-version "5.2.1">>

|''purpose'' |modify input titles by evaluating in turn a list of filters - as returned by the filter expression for this run - for each input title. |
|''input'' |all titles from previous filter runs |
|''output''|the input titles as modified by the filters returned by this filter run |

The filter expression for this filter run is evaluated to return a list of filters. Each input title is then evaluated against each of the filters in turn, and the input title is replaced with the first result of the first filter that returns a non-empty list. If none of the filters return a result for an input title, it is replaced with an empty string.

The following variables are available within the filter run:

* <<.var currentTiddler>> - the input title
* <<.var ..currentTiddler>> - the value of the variable `currentTiddler` outside the filter run.

[[Examples|Cascade Filter Run Prefix (Examples)]]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
created: 20150124182421000
modified: 20210618153333369
modified: 20211129014550442
tags: [[Filter Syntax]]
title: Filter Expression
type: text/vnd.tiddlywiki
Expand All @@ -23,9 +23,11 @@ If a run has:
* the prefix `~`, if the filter output so far is an empty list then the output titles of the run are [[dominantly appended|Dominant Append]] to the filter's output. If the filter output so far is not an empty list then the run is ignored. <<.from-version "5.1.18">>
* named prefixes for filter runs are available. <<.from-version "5.1.23">>
* named prefix `:filter`, it receives the filter output so far as its input. The next run is evaluated for each title of the input, removing every input title for which the output is an empty list. <<.from-version "5.1.23">>
** See [[Filter Filter Run Prefix]].
* named prefix `:intersection` replaces all filter output so far with titles that are present in the output of this run, as well as the output from previous runs. Forms the input for the next run. <<.from-version "5.1.23">>
** See [[Intersection Filter Run Prefix]].
* named prefix `:reduce` replaces all filter output so far with a single item by repeatedly applying a formula to each input title. A typical use is to add up the values in a given field of each input title. <<.from-version "5.1.23">>
** [[Examples|Filter Run Prefix (Examples)]]
** See [[Reduce Filter Run Prefix]].
* named prefix `:sort` sorts all filter output so far by applying this run to each input title and sorting according to that output. <<.from-version "5.2.0">>
** See [[Sort Filter Run Prefix]].
* named prefix `:map` transforms all filter output so far by applying this run to each input title and replacing the input title with the output of this run for that title.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
created: 20211129022707404
modified: 20211204154839890
tags: [[Filter Syntax]] [[Filter Run Prefix Examples]] [[Filter Filter Run Prefix]]
title: Filter Filter Run Prefix (Examples)
type: text/vnd.tiddlywiki

<<.operator-example 1 "[tag[HelloThere]] :filter[get[text]length[]compare:integer:gteq[1000]]">>
<<.operator-example 2 "[tag[HelloThere]] :filter[get[text]length[]compare:integer:lteq[2000]]">>
<<.operator-example 3 "[tag[HelloThere]] :filter[get[text]length[]compare:integer:gteq[1000]] :filter[get[text]length[]compare:integer:lteq[2000]]">>
<<.operator-example 4 "[tag[Features]] :filter[links[]!is[shadow]is[missing]]">>

<<.operator-example 5 "A B C D E F :filter[<index>remainder[2]compare:integer:eq[0]]" "Return every other element of the input list">>

<<.operator-example 6 "[tag[shopping]] :filter[{!!quantity}compare:integer:gt[4]] :map[addprefix[ ]addprefix{!!quantity}]">>
<<.operator-example 7 "[tag[shopping]] :filter[{!!quantity}compare:integer:lteq[4]] :map[addprefix[ ]addprefix{!!quantity}]">>

!! Comparison between `:filter` and `:and`/`+` filter run prefixes

The functionality of the <<.op :filter>> filter run prefix has some overlap with the <<.op :and>> prefix (alias <<.op +>>). Notice the filter expressions above all have the following two properties:

# The start of the filter expression transforms the input titles (i.e. `get[text]length[]`, `links[]`, `<index>remainder[2]`, `{!!quantity}`.
# The end of the filter expression only sends input items to the output if they meet some condition (i.e. `compare`, `is`).

The purpose of the <<.op :filter>> prefix is to return the original input titles despite property #1 causing those input titles to be transformed. That way, the "meet some condition" check can be performed on something other than the original input. If some filter expression does not require property #1, then the <<.op :and>> prefix can be used instead.

| <<.op :filter>> | <<.op :and>> |
|^<<.operator-example c1.1 "[tag[HelloThere]] :filter[get[text]length[]compare:integer:gteq[1000]]">>|^<<.operator-example c1.2 "[tag[HelloThere]] :and[get[text]length[]compare:integer:gteq[1000]]">>|
|^<<.operator-example c2.1 "[tag[Features]] :filter[links[]!is[shadow]is[missing]]">>|^<<.operator-example c2.2 "[tag[Features]] :and[links[]!is[shadow]is[missing]]">>|
|!results are the same|<|
|^<<.operator-example c3.1 "cat can bat bug :filter[suffix[at]minlength[3]]">>|^<<.operator-example c3.2 "cat can bat bug :and[suffix[at]minlength[3]]">>|
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
created: 20211129022455873
modified: 20211129022550425
tags: [[Filter Syntax]] [[Filter Run Prefix]]
title: Filter Filter Run Prefix
type: text/vnd.tiddlywiki

<<.from-version "5.1.23">>

|''purpose'' |remove every input title for which the filter run output is an empty list |
|''input'' |all titles from previous filter runs |
|''output''|the input titles for which the filter run is not empty |

It receives the filter output so far as its input. The next run is evaluated for each title of the input, removing every input title for which the output is an empty list.

Note that within the filter run, the "currentTiddler" variable is set to the title of the tiddler being processed. This permits filter runs like `:filter[{!!price}multiply{!!cost}compare:integer:gteq[5]]` to be used for computation. The value of currentTiddler outside the run is available in the variable "..currentTiddler".

The following variables are available within the filter run:

* ''currentTiddler'' - the input title
* ''..currentTiddler'' - the value of the variable `currentTiddler` outside the filter run.
* ''index'' - <<.from-version "5.2.1">> the numeric index of the current list item (with zero being the first item in the list).
* ''revIndex'' - <<.from-version "5.2.1">> the reverse numeric index of the current list item (with zero being the last item in the list).
* ''length'' - <<.from-version "5.2.1">> the total length of the input list.

<<.tip "Compare named filter run prefix `:filter` with [[filter Operator]] which applies a subfilter to every input title, removing the titles that return an empty result from the subfilter">>

[[Examples|Filter Filter Run Prefix (Examples)]]
Original file line number Diff line number Diff line change
@@ -1,50 +1,21 @@
created: 20201117073343969
modified: 20210428084013109
modified: 20211129032537195
tags: [[Filter Syntax]] [[Filter Run Prefix Examples]]
title: Filter Run Prefix (Examples)
type: text/vnd.tiddlywiki

!! Difference between `+` and `:intersection`
!! `:filter` examples

The `+` prefix should be thought of as an "AND" in formal logic, e.g. "give me all titles that satisfy condition A ''and'' condition B". But it's not suitable for all cases; if condition B uses a filter operator that replaces its input, then it will be difficult to use the `+` prefix. For example, if you wanted to find out what tags two tiddlers have in common, you might try to write a filter expression like:
See [[Filter Filter Run Prefix (Examples)]]

* <$link to="tags Operator">`[[field Operator]tags[]] +[[compare Operator]tags[]]`</$link>
!! `:intersection` examples

But that won't work, because the second filter run will end up throwing away its input and replacing it with an input consisting of the single title `[[compare Operator]]`. So the result you'd get from that filter expression would be just the tags of the `compare Operator` tiddler.

For cases like this, the `:intersection` prefix is what you need. It takes the filter output so far, //sets it aside//, and starts the next filter run with all tiddler titles as input. Then once the latest filter run has completed, it takes the latest output, compares it to the set-aside output, and produces a new output that contains only titles that appeared in both the set-aside output and the latest output. So to get only the tags that the `field Operator` and `compare Operator` tiddlers have in common, you would write a filter expression like this:

* <$link to="tags Operator">`[[field Operator]tags[]] :intersection[[compare Operator]tags[]]`</$link>

The following examples use the [[field Operator]] and [[compare Operator]] tiddlers and their respective tags.

<<.operator-example 1 "[[field Operator]tags[]]">>
<<.operator-example 2 "[[compare Operator]tags[]]">>

<<.operator-example 3 "[[field Operator]tags[]] +[[compare Operator]tags[]]" """The "field Operator" tiddler's tags are lost, so only the "compare Operator" tiddler's tags are returned""">>

<<.operator-example 4 "[[field Operator]tags[]] :intersection[[compare Operator]tags[]]" """Returns the tags that both tiddlers have in common""">>
See [[Intersection Filter Run Prefix (Examples)]]

!! `:reduce` examples

```
[tag[shopping]] :reduce[get[quantity]add<accumulator>]
```

is equivalent to:

```
\define num-items() [get[quantity]add<accumulator>]

[tag[shopping]reduce<num-items>]
```

Specifying a default value when input is empty:

`[tag[non-existent]] :reduce[get[price]multiply{!!quantity}add<accumulator>] :else[[0]]`

<$macrocall $name=".tip" _="""Unlike the [[reduce Operator]], the `:reduce` prefix cannot specify an initial value for the accumulator, so its initial value will always be empty (which is treated as 0 by mathematical operators). So `=1 =2 =3 :reduce[multiply<accumulator>]` will produce 0, not 6. If you need to specify an initial accumulator value, use the [[reduce Operator]]."""/>
See [[Reduce Filter Run Prefix (Examples)]]

!! `:sort` examples

See [[Sort Filter Run Prefix (Examples)]]
See [[Sort Filter Run Prefix (Examples)]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
created: 20211128212902292
modified: 20211128233320674
tags: [[Filter Syntax]] [[Filter Run Prefix Examples]] [[Intersection Filter Run Prefix]]
title: Intersection Filter Run Prefix (Examples)
type: text/vnd.tiddlywiki

<<.operator-example 1 "A B C D :intersection[enlist[C D E F]]">>

<<.operator-example 2 "A B C D :intersection[enlist[A B C D]]">>

<<.operator-example 3 "A B C D :intersection[enlist[E F G H]]">>

<<.operator-example 4 ":intersection[enlist[A B C D]]" "Using intersection in the first filter run is of little use. The result will always be empty.">>

!! Difference between `+` and `:intersection`

The `+` prefix should be thought of as an "AND" in formal logic, e.g. "give me all titles that satisfy condition A ''and'' condition B". But it's not suitable for all cases; if condition B uses a filter operator that replaces its input, then it will be difficult to use the `+` prefix. For example, if you wanted to find out what tags two tiddlers have in common, you might try to write a filter expression like:

* <$link to="tags Operator">`[[field Operator]tags[]] +[[compare Operator]tags[]]`</$link>

But that won't work, because the second filter run will end up throwing away its input and replacing it with an input consisting of the single title `[[compare Operator]]`. So the result you'd get from that filter expression would be just the tags of the `compare Operator` tiddler.

For cases like this, the `:intersection` prefix is what you need. It takes the filter output so far, //sets it aside//, and starts the next filter run with all tiddler titles as input. Then once the latest filter run has completed, it takes the latest output, compares it to the set-aside output, and produces a new output that contains only titles that appeared in both the set-aside output and the latest output. So to get only the tags that the `field Operator` and `compare Operator` tiddlers have in common, you would write a filter expression like this:

* <$link to="tags Operator">`[[field Operator]tags[]] :intersection[[compare Operator]tags[]]`</$link>

The following examples use the [[field Operator]] and [[compare Operator]] tiddlers and their respective tags.

<<.operator-example 5 "[[field Operator]tags[]]">>
<<.operator-example 6 "[[compare Operator]tags[]]">>

<<.operator-example 7 "[[field Operator]tags[]] +[[compare Operator]tags[]]" """The "field Operator" tiddler's tags are lost, so only the "compare Operator" tiddler's tags are returned""">>

<<.operator-example 8 "[[field Operator]tags[]] :intersection[[compare Operator]tags[]]" """Returns the tags that both tiddlers have in common""">>


Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
created: 20211128212902292
modified: 20211128212904721
tags: [[Filter Syntax]] [[Filter Run Prefix]]
title: Intersection Filter Run Prefix
type: text/vnd.tiddlywiki

<<.from-version "5.1.23">>

|''purpose'' |find the intersection of titles from previous runs with titles in this filter run |
|''input'' |all titles from previous filter runs |
|''output''|the titles that are present in both the result of this filter run and the output from previous runs |

The filter output from previous runs is set aside. The `:intersection` filter run is started with all tiddler titles as input. Once this latest filter run has completed, the latest output is compared to the set-aside output. A new output is produced that contains only titles that appeared in both the set-aside output and the latest output.

[[Examples|Intersection Filter Run Prefix (Examples)]]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
created: 20210618134753828
modified: 20210618140945870
modified: 20211125152755859
tags: [[Filter Syntax]] [[Filter Run Prefix Examples]] [[Map Filter Run Prefix]]
title: Map Filter Run Prefix (Examples)
type: text/vnd.tiddlywiki
Expand All @@ -14,3 +14,28 @@ Replace the input titles with the caption field if it exists, otherwise preserve
For each title in a shopping list, calculate the total cost of purchasing each item:

<<.operator-example 2 "[tag[shopping]] :map[get[quantity]else[0]multiply{!!price}]">>

!! Comparison between `:map` and `:and`/`+` filter run prefixes

The functionality of the `:map` filter run prefix has some overlap with the `:and` prefix (alias `+`). They will sometimes return the same results as each other. In at least these cases, the results will be different:

# The `:and` filter run can modify the number of items (either increase or decrease). The `:map` run will never alter the number of items.
# The number of items in the `:and` filter run will also decrease due to de-duplication. The `:map` run will not de-duplicate.
# Explicit references to the "currentTiddler" variable will behave differently
# Implicit references to the "currentTiddler" using TextReference will behave differently.

| `:map` | `:and` |
|!results are the same|<|
|^<<.operator-example 1.1 "[range[5]] :map[add[1]]">>|^<<.operator-example 1.2 "[range[5]] :and[add[1]]">>|
|^<<.operator-example 2.1 "[range[5]] :map[addsuffix[ hello]]">>|^<<.operator-example 2.2 "[range[5]] :and[addsuffix[ hello]]">>|
|^<<.operator-example 3.1 "[tag[shopping]] :map[get[quantity]]">>|^<<.operator-example 3.2 "[tag[shopping]] :and[get[quantity]]">>|
|!decrease in the number of items|<|
|^<<.operator-example 4.1 "[range[5]] :map[sum[]]">>|^<<.operator-example 4.2 "[range[5]] :and[sum[]]">>|
|^<<.operator-example 5.1 "[range[5]] :map[join[,]]">>|^<<.operator-example 5.2 "[range[5]] :and[join[,]]">>|
|!increase in the number of items|<|
|^<<.operator-example 6.1 "[[1,2,3]] [[4,5]] :map[split[,]]">>|^<<.operator-example 6.2 "[[1,2,3]] [[4,5]] :and[split[,]]">>|
|!de-duplication|<|
|^<<.operator-example 7.1 "[range[5]] :map[[hello]]">>|^<<.operator-example 7.2 "[range[5]] :and[[hello]]">>|
|!currentTiddler|<|
|^<<.operator-example 8.1 "[tag[shopping]] :map[<currentTiddler>]">>|^<<.operator-example 8.2 "[tag[shopping]] :and[<currentTiddler>]">>|
|^<<.operator-example 9.1 "[tag[shopping]] :map[{!!quantity}]">>|^<<.operator-example 9.2 "[tag[shopping]] :and[{!!quantity}]">>|
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
created: 20210618133745003
modified: 20210618134747652
modified: 20211029025541750
tags: [[Filter Syntax]] [[Filter Run Prefix]]
title: Map Filter Run Prefix
type: text/vnd.tiddlywiki
Expand All @@ -14,6 +14,14 @@ Each input title from previous runs is passed to this run in turn. The filter ru

Note that within the filter run, the "currentTiddler" variable is set to the title of the tiddler being processed. This permits filter runs like `:map[{!!price}multiply{!!cost}]` to be used for computation. The value of currentTiddler outside the run is available in the variable "..currentTiddler".

The following variables are available within the filter run:

* ''currentTiddler'' - the input title
* ''..currentTiddler'' - the value of the variable `currentTiddler` outside the filter run.
* ''index'' - <<.from-version "5.2.1">> the numeric index of the current list item (with zero being the first item in the list).
* ''revIndex'' - <<.from-version "5.2.1">> the reverse numeric index of the current list item (with zero being the last item in the list).
* ''length'' - <<.from-version "5.2.1">> the total length of the input list.

Filter runs used with the `:map` prefix should return the same number of items that they are passed. Any missing entries will be treated as an empty string. In particular, when retrieving the value of a field with the [[get Operator]] it is helpful to guard against a missing field value using the [[else Operator]]. For example `[get[myfield]else[default-value]...`.

[[Examples|Map Filter Run Prefix (Examples)]]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20201214044413473
modified: 20201214053018350
tags:
modified: 20211118025845599
tags: [[Filter Syntax]]
title: Named Filter Run Prefix

<$set name="prefixlist" filter="""[all[shadows+tiddlers]has[module-type]module-type[filterrunprefix]trim:prefix[$:/core/modules/filterrunprefixes/]trim:suffix[.js]addprefix["]addsuffix["]join[|]addprefix[(]addsuffix[)]]""">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
created: 20211124151912931
modified: 20211124160747921
tags: [[Filter Syntax]] [[Reduce Filter Run Prefix]] [[Filter Run Prefix Examples]]
title: Reduce Filter Run Prefix (Examples)
type: text/vnd.tiddlywiki

\define multiply-input() [multiply<accumulator>]

The following examples use these data tiddlers:

<ul>
<$list filter="[tag[shopping]!has[draft.of]]">
<li>
''<$link><$text text=<<currentTiddler>>/></$link>'' quantity: <$text text={{!!quantity}}/>, price: <$text text={{!!price}}/>
</li>
</$list>
</ul>

<<.operator-example 1 "[tag[shopping]] :reduce[get[quantity]add<accumulator>]">>
<<.operator-example 2 "[tag[shopping]] :reduce[get[price]multiply{!!quantity}add<accumulator>]">>
<<.operator-example 3 "[tag[shopping]] :reduce[<index>compare:number:gt[0]then<accumulator>addsuffix[, ]addsuffix<currentTiddler>else<currentTiddler>]" "Uses `<index>` to act differently on the first item than the rest. Just for demonstration. Better to use the [[join Operator]] to accomplish this task">>
<<.operator-example 4 "[tag[non-existent]] :reduce[get[price]multiply{!!quantity}add<accumulator>]" "Empty input produces empty output">>
<<.operator-example 5 "[tag[non-existent]] :reduce[get[price]multiply{!!quantity}add<accumulator>] :else[[0]]" "Use `:else` to ensure output if input was empty">>

<$macrocall $name=".tip" _="""Unlike the [[reduce Operator]], the `:reduce` prefix cannot specify an initial value for the accumulator, so its initial value will always be empty (which is treated as 0 by mathematical operators). So `=1 =2 =3 :reduce[multiply<accumulator>]` will produce 0, not 6. If you need to specify an initial accumulator value, use the [[reduce Operator]]."""/>
<<.operator-example 6 "=1 =2 =3 :reduce[multiply<accumulator>]" "Empty initial value is treated as 0 by mathematical operators">>
<<.operator-example 7 "=1 =2 =3 +[reduce<multiply-input>,[1]]" "Setting initial value is sometimes necessary for correct results">>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
created: 20211124151912931
modified: 20211124170117511
tags: [[Filter Syntax]] [[Filter Run Prefix]]
title: Reduce Filter Run Prefix
type: text/vnd.tiddlywiki

<<.from-version "5.1.23">>

|''purpose'' |replaces all filter output so far with a single item by repeatedly applying a filter run to each input title |
|''input'' |all titles from previous filter runs |
|''output''|the accumulated single item |

Each input title from previous runs is passed to this run in turn. The result of each previous call to this run is made available in the next call via the variable named "accumulator". The result of the last call to this run is returned as the output. A typical use is to add up the values in a given field of each input title.

The following variables are available within the filter run:

* ''accumulator'' - the result of the previous filter run
* ''currentTiddler'' - the input title
* ''..currentTiddler'' - the value of the variable `currentTiddler` outside the filter run. <<.from-version "5.2.0">>
* ''index'' - the numeric index of the current list item (with zero being the first item in the list)
* ''revIndex'' - the reverse numeric index of the current list item (with zero being the last item in the list)
* ''length'' - the total length of the input list

<<.tip "Compare named filter run prefix `:reduce` with [[reduce Operator]] which is used to flatten a list of items down to a single item by repeatedly applying a subfilter.">>

```
[tag[shopping]] :reduce[get[quantity]add<accumulator>]
```

is equivalent to:

```
\define num-items() [get[quantity]add<accumulator>]

[tag[shopping]reduce<num-items>]
```

[[Examples|Reduce Filter Run Prefix (Examples)]]
13 changes: 13 additions & 0 deletions editions/tw5.com/tiddlers/filters/tan Operator.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
caption: tan
created: 20211019211156303
modified: 20211021222828332
op-input: a [[selection of titles|Title Selection]]
op-output: the tangent of the input angles
op-purpose: calculate the tangent value of a list of angles (given in radians)
tags: [[Filter Operators]] [[Mathematics Operators]] [[Trigonometric Operators]] [[Unary Mathematics Operators]]
title: tan Operator
type: text/vnd.tiddlywiki

<<.from-version "5.1.21">> See [[Mathematics Operators]] for an overview.

<<.operator-examples "tan">>
18 changes: 18 additions & 0 deletions editions/tw5.com/tiddlers/filters/zth Operator.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
caption: zth
created: 20211029023242012
modified: 20211029023711450
op-input: a [[selection of titles|Title Selection]]
op-output: the <<.place Z>>th input title
op-parameter: an integer, defaulting to 0
op-parameter-name: Z
op-purpose: select the <<.place Z>>th input title
tags: [[Filter Operators]] [[Order Operators]]
title: zth Operator
type: text/vnd.tiddlywiki

<<.from-version 5.2.1>>
<<.place Z>> is zero-based. In other words, `zth[0]` has the same effect as `nth[1]` and the <<.olink first>> operator.

<<.tip "See <<.olink nth>> for an equivalent operator with a 1 based parameter">>

<<.operator-examples "zth">>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
caption: Android
created: 20140811171036268
modified: 20160430121735629
modified: 20211114031651878
tags: GettingStarted
title: GettingStarted - Android
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
caption: Chrome
created: 20140811165935523
modified: 20140811170107969
modified: 20211114031651878
tags: GettingStarted
title: GettingStarted - Chrome
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
caption: Firefox
created: 20140811170425199
modified: 20140811170527083
modified: 20211114031651878
tags: GettingStarted
title: GettingStarted - Firefox
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
caption: Internet Explorer
created: 20140811172058274
modified: 20140811172247864
modified: 20211114031651879
tags: GettingStarted
title: GettingStarted - Internet Explorer
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
caption: Node.js
created: 20140811172010003
modified: 20140811172012677
modified: 20211114031651879
tags: GettingStarted
title: GettingStarted - Node.js
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
caption: Online
created: 20160216191710789
modified: 20170222152427476
tags:
modified: 20211114031651879
tags: GettingStarted
title: GettingStarted - Online
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
caption: Safari
created: 20140811171121022
modified: 20150325173956502
modified: 20211114031651879
tags: GettingStarted
title: GettingStarted - Safari
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
caption: iPad/iPhone
created: 20140811170918707
modified: 20140811170921731
modified: 20211114031651879
tags: GettingStarted
title: GettingStarted - iOS
type: text/vnd.tiddlywiki

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion editions/tw5.com/tiddlers/hellothere/HelloThere.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20130822170200000
list: [[A Gentle Guide to TiddlyWiki]] [[Discover TiddlyWiki]] [[Some of the things you can do with TiddlyWiki]] [[Ten reasons to switch to TiddlyWiki]] Examples [[What happened to the original TiddlyWiki?]] [[HelloThumbnail - TWEUM2017]]
modified: 20211003151502543
modified: 20211208115833846
tags: TableOfContents
title: HelloThere
type: text/vnd.tiddlywiki
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
created: 20140904090300000
modified: 20160602051709631
modified: 20211018102355896
tags: HelloThere
title: Some of the things you can do with TiddlyWiki
type: text/vnd.tiddlywiki
Expand All @@ -11,7 +11,7 @@ type: text/vnd.tiddlywiki
* Inventory just about anything: your recipes, personal library, contacts, music collection, and more
* Create a blog or website
* Write a book
* Organise your images into galleries (see our [[ImageGallery Example]])
* Organise your images into galleries (see [[Icon Gallery]])
* Share the information in your ~TiddlyWiki with others, as an online file, as a file attachment, as a tiddler file, or as a link to a specific online tiddler (try clicking and dragging a tiddler from one ~TiddlyWiki file to another to see what happens)
* Draw a sketch (Edit [[Motovun Jack.jpg]] and start drawing over the image to see what happens)
* Use familiar web user interface elements such as lightboxes - see SampleWizard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
title: ProductHunt-Badge.svg
type: image/svg+xml
tags: [[HelloThere Badge]]

<?xml version="1.0" encoding="UTF-8"?>
<svg width="250px" height="54px" viewBox="0 0 250 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
title: Product Hunt Link
tags: [[HelloThere Badge]]

<a href="https://www.producthunt.com/posts/tiddlywiki-2?utm_source=badge-top-post-badge&utm_medium=badge&utm_souce=badge-tiddlywiki-2" alt="Product Hunt: Product of the Day" target="_blank" rel="noopener noreferrer">{{ProductHunt-Badge.svg}}</a>
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
created: 20211116222524148
modified: 20211116222535549
tags: [[Hidden Settings]]
title: Hidden Setting: New-Image Type
tags: [[Hidden Setting]]
type: text/vnd.tiddlywiki

By default new images are created with the image-type `jpeg`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
created: 20211028083211182
modified: 20211029090311444
tags: [[Hidden Settings]]
title: Hidden Setting: Show Edit Preview per Tiddler

Controls whether the [[tiddler editing preview|Text preview]] is controlled globally (the default) or on a per-tiddler basis.

Set it to ''yes'' to enable per-tiddler mode.

$:/config/ShowEditPreview/PerTiddler
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ tags: [[Hidden Settings]]
title: Hidden Setting: Typing Refresh Delay
type: text/vnd.tiddlywiki

TiddlyWiki defers processing changes to draft tiddlers until a timeout has elapsed (this is called throttling). The mechanism can be extended to other tiddlers by adding a `throttle.refresh` field. See RefreshThrottling for details.
TiddlyWiki defers processing changes to draft tiddlers and tiddlers with the prefix `$:/temp/volatile/` until a timeout has elapsed (this is called throttling). The mechanism can be extended to other tiddlers by adding a `throttle.refresh` field. See RefreshThrottling for details.

The default value of 400ms gives a good balance of responsiveness in most cases but isn't always optimal on lower powered mobile devices.

The timeout can now be changed by changing this value (in milliseconds):

$:/config/Drafts/TypingTimeout
$:/config/Drafts/TypingTimeout
54 changes: 21 additions & 33 deletions editions/tw5.com/tiddlers/howtos/Creating SubStories.tid
Original file line number Diff line number Diff line change
@@ -1,44 +1,32 @@
created: 20140214215718317
modified: 20140919161514318
modified: 20211127032217828
tags: Learning
title: Creating SubStories
type: text/vnd.tiddlywiki

This example shows how to create a sub-story within a tiddler that is independent of the main story.
This example shows how to create a sub-story within a tiddler that is independent of the main [[story|Story River]]. The NavigatorWidget and ListWidget work together to:

Here's the code:
# Add tiddlers to the [[story|Story River]] when links are clicked. Navigate to the tiddler corresponding to the link click. (''story'' attribute of the NavigatorWidget)
# Remove tiddlers from the [[story|Story River]] when tiddler close buttons are clicked. (''story'' attribute of NavigatorWidget)
# Animate the opening and closing of tiddlers. (''storyview'' attribute of the ListWidget)
# Display the list of open tiddlers. (''filter'' and ''template'' attributes of the ListWidget)
# Display tiddlers in [[draft mode|DraftMechanism]]. (''editTemplate'' attribute of the ListWidget)
# Track [[navigation history|HistoryMechanism]]. (''history'' attribute of both NavigatorWidget and ListWidget)
# And more!

```
<$navigator story="MySubStoryList" history="MySubHistoryList">
Here is the example code (see also StateMechanism for related discussion):

Click this link to get started: HelloThere
<$macrocall $name='wikitext-example-without-html'
src='<$navigator story="$:/temp/DemoStoryList" history="$:/temp/DemoHistoryList">

<$list filter="[list[MySubStoryList]]" history="MySubHistoryList">
<div>
{{$:/core/ui/SideBarSegments/search}}

! <$button message="tm-close-tiddler" class="tc-btn-invisible">{{$:/core/images/close-button}}</$button> <$view field="title"/>
<$list
filter="[list[$:/temp/DemoStoryList]]"
history="$:/temp/DemoHistoryList"
template={{$:/config/ui/ViewTemplate}}
editTemplate={{$:/config/ui/EditTemplate}}
storyview="classic"
emptyMessage="Use search box above. Clicked search links will open here instead of in the main story.<p>No search ideas? Click this link to get started: HelloThere</p>"/>

<$transclude/>
</div>
</$list>

</$navigator>
```

Note how you can open the HelloThere tiddler in the substory by clicking on the link below. Links within the substory open within the substory, and not in the main story.

<$navigator story="MySubStoryList" history="MySubHistoryList">

Click this link to get started: HelloThere

<$list filter="[list[MySubStoryList]]" history="MySubHistoryList">
<div>

! <$button message="tm-close-tiddler" class="tc-btn-invisible">{{$:/core/images/close-button}}</$button> <$view field="title"/>

<$transclude/>

</div>
</$list>

</$navigator>
</$navigator>'>
11 changes: 11 additions & 0 deletions editions/tw5.com/tiddlers/howtos/Debugging Stylesheets.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
created: 20211125175712017
modified: 20211125175906085
tags: [[Using Stylesheets]]
title: Debugging Stylesheets
type: text/vnd.tiddlywiki

The core shadow tiddler $:/snippets/DebugStylesheets contains a simple tool for tracking down certain problems with mismatched brackets and other nested structures.

In the list below, any stylesheets containing an error will be marked with a red cross:

{{$:/snippets/DebugStylesheets}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
created: 20211204120244761
modified: 20211206165108185
tags: Learning Cascades [[Story Tiddler Template]] [[Story Tiddler Template Cascade]] [[Customise TiddlyWiki]]
title: How to create a custom story tiddler template
type: text/vnd.tiddlywiki

Here we show how to add a rule to the [[Story Tiddler Template Cascade]] that causes tiddlers tagged <<tag "$:/tags/TiddlerList">> to be displayed with a custom appearance incorporating thumbnails of the tiddlers named in the list field.

Open [[Demo Tiddler List with Custom Story Tiddler Template]] to see the demo.

First, we add a new step to the story tiddler template cascade. The new filter step is:

```
[tag[$:/tags/TiddlerList]then[$:/_tw5.com/CustomStoryTiddlerTemplateDemo/Template]]
```

It can be read as:

```
If the tiddler has the tag $:/tags/TiddlerList then return $:/_tw5.com/CustomStoryTiddlerTemplateDemo/Template
```

> The template $:/_tw5.com/CustomStoryTiddlerTemplateDemo/Template also depends on styles defined in [[$:/_tw5.com/CustomStoryTiddlerTemplateDemo/Styles]].

The story tiddler template cascade is defined by the tag <<tag "$:/tags/StoryTiddlerTemplateFilter">>, so we need to create a configuration tiddler with that tag.

We also need to make sure that it is inserted at the correct point in the cascade:

* The new rule must be after the "draft" rule to ensure that draft tiddlers with the tag $:/tags/TiddlerList can be edited
* The new rule must be before the "default" rule otherwise it will never be executed

The control panel "Cascades" tab shows that this can be achieved by inserting the new step immediately before the default step using the `list-before` field.

The full list of fields in the configuration tiddler is:

<<.tiddler-fields "$:/_tw5.com/CustomStoryTiddlerTemplateDemo/Filter">>

Finally, we need to create the demo tiddler itself:

<<.tiddler-fields "Demo Tiddler List with Custom Story Tiddler Template">>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
created: 20211206114114698
modified: 20211206165150302
tags: Learning Cascades [[Customise TiddlyWiki]]
title: How to create a custom tiddler colour rule
type: text/vnd.tiddlywiki

Here we show how to add a rule to the [[Tiddler Colour Cascade]] that causes tiddlers with the tag <<tag "TableOfContents">> to be given a bright blue colour and tiddlers with the tag <<tag "Working with TiddlyWiki">> to be given a dark purple colour.

<<.tip "[[How to create a custom tiddler icon rule]] describes how the same tiddlers have been given a custom icon">>

First, we add a new step to the tiddler colour cascade. The new filter step is:

```
[tag[TableOfContents]then[#1e90ff]]
[tag[Working with TiddlyWiki]then[darkorchid]]
```

It can be read as:

```
If the tiddler has the tag "TableOfContents" then return the colour #1e90ff
Else if the tiddler has the tag "Working with TiddlyWiki" then return the colour darkorchid
```

The tiddler colour cascade is defined by the tag <<tag "$:/tags/TiddlerColourFilter">>, so we need to create a configuration tiddler with that tag.

We also need to make sure that it is inserted at the correct point in the cascade:

* The new rule must be after the "colour-field" rule to ensure that tiddlers with an explicit ''color'' field will respect the value of that field
* The new rule must be before the "default" icon otherwise it will never be seen if the default colour is specified

The control panel "Cascades" tab shows that this can be achieved by inserting the new step immediately before the default step using the `list-before` field.

The full list of fields in the configuration tiddler is:

<<.tiddler-fields "$:/_tw5.com/CustomTiddlerColourCascadeDemo">>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
created: 20211204161649863
modified: 20211206165129215
tags: Learning Cascades [[Tiddler Icon Cascade]] [[Customise TiddlyWiki]]
title: How to create a custom tiddler icon rule
type: text/vnd.tiddlywiki

Here we show how to add a rule to the [[Tiddler Icon Cascade]] that causes tiddlers with the tag <<tag "TableOfContents">> to be given the "globe" icon <<.icon $:/core/images/globe>> and tiddlers with the tag <<tag "Working with TiddlyWiki">> to be given the "help" icon <<.icon $:/core/images/help>>.

<<.tip "[[How to create a custom tiddler colour rule]] describes how the same tiddlers have been given a custom colour">>

First, we add a new step to the tiddler icon cascade. The new filter step is:

```
[tag[TableOfContents]then[$:/core/images/globe]]
[tag[Working with TiddlyWiki]then[$:/core/images/help]]
```

It can be read as:

```
If the tiddler has the tag "TableOfContents" then return $:/core/images/globe
Else if the tiddler has the tag "Working with TiddlyWiki" then return $:/core/images/help
```

The tiddler icon cascade is defined by the tag <<tag "$:/tags/TiddlerIconFilter">>, so we need to create a configuration tiddler with that tag.

We also need to make sure that it is inserted at the correct point in the cascade:

* The new rule must be after the "icon-field" rule to ensure that tiddlers with an explicit ''icon'' field will respect the value of that field
* The new rule must be before the "default" icon otherwise it will never be seen if the default icon is specified

The control panel "Cascades" tab shows that this can be achieved by inserting the new step immediately before the default step using the `list-before` field.

The full list of fields in the configuration tiddler is:

<<.tiddler-fields "$:/_tw5.com/CustomTiddlerIconCascadeDemo">>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
created: 20201216182347597
modified: 20201217193318816
modified: 20211018102328148
tags:
title: How to create dynamic editor toolbar buttons
type: text/vnd.tiddlywiki
Expand Down Expand Up @@ -86,7 +86,7 @@ This tiddler contains all the necessary elements that are important for toolbar
: Is used as the button tooltip

; icon
: Assigns the button icon. We use `$:/core/images/spiral` {{$:/core/images/spiral}} here.
: Assigns the button icon. We use `$:/core/images/spiral` {{$:/core/images/spiral}} here. More button icons can be found in the [[Icon Gallery]]

; shortcuts
: This is the [[Keyboard Shortcut Descriptor]] eg: `((temp-bold))`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20180310002601813
modified: 20180310003428093
tags: Learning
modified: 20211106021629911
tags: Learning [[How to apply custom styles]]
title: Simple ways to write protect tiddlers
type: text/vnd.tiddlywiki

Expand All @@ -10,9 +10,8 @@ Sometimes you want to protect individual tiddlers from accidental changes, eithe

Create a tiddler with the following contents and tag it as `$:/tags/Stylesheet` :

```
.tc-tagged-Locked button[title="Edit this tiddler"] {display: none;}

```css
[data-tags*="Locked"] button[title="Edit this tiddler"] {display: none;}
```

If your TW language isn't English, then you'll need to change the text in 'title="...."' to whatever the text is when you hover over the edit button.
Expand Down
8 changes: 6 additions & 2 deletions editions/tw5.com/tiddlers/howtos/Text preview.tid
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
created: 20160817104110857
modified: 20160817104802841
modified: 20211029090145708
tags: [[Editor toolbar]]
title: Text preview

Pressing the eye icon {{$:/core/ui/EditorToolbar/preview}} will open or close a preview window for your WikiText (The icon-eye will also open or close).
Pressing the eye icon {{$:/core/ui/EditorToolbar/preview}} will open or close a preview window showing the results of rendering the WikiText (the icon-eye will also open or close).

Right to the eye there is another icon, {{$:/core/images/chevron-down}}, which when clicked, shows you a dropdown which gives you access to six different types of preview:

Expand All @@ -12,3 +12,7 @@ Right to the eye there is another icon, {{$:/core/images/chevron-down}}, which w
* //parsetree// and //widgettree// show you the two object trees that ~TiddlyWiki internally generates from ~WikiText. The //parsetree// collects basic information about your ~WikiText. From the informations of the parsetree the //widgettree// then generates extended informations and finally the above html (and the widgettree also does other things).
* //differences from current// shows you the differences since the tiddler was last saved. Deleted parts are <span style="color:red;">red</span>, added parts are <span style="color:green;">green</span>.
* //differences from shadow (if any)// does the same, but this time it shows you the differences to the underlying [[shadow-tiddler|ShadowTiddlers]].

<<.tip "By default, the preview pane button controls whether the preview pane is displayed for all tiddlers that are open for editing. There is a [[hidden setting|Hidden Setting: Show Edit Preview per Tiddler]] to make the button work on a per-tiddler basis">>

<<.tip "The variable [[tv-tiddler-preview|tv-tiddler-preview Variable]] can be used to detect whether content is being displayed in the preview pane.">>
12 changes: 8 additions & 4 deletions editions/tw5.com/tiddlers/howtos/Using Stylesheets.tid
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
created: 20140305091244145
modified: 20210104090402829
modified: 20211125175708977
tags: [[Customise TiddlyWiki]]
title: Using Stylesheets
type: text/vnd.tiddlywiki
Expand All @@ -16,9 +16,9 @@ type: text/vnd.tiddlywiki

The first steps to changing the appearance of ~TiddlyWiki are to choose and apply:

* One of the available themes: <span class="tc-btn-standard"> {{$:/core/ui/Buttons/theme}} </span>
* Modify the colour palette: <span class="tc-btn-standard"> {{$:/core/ui/Buttons/palette}} </span>
* Experiment with the <$button actions=<<openCpTheme>> ><<.icon $:/core/images/options-button>> ControlPanel</$button>
* One of the available themes: {{$:/core/ui/Buttons/theme}}
* Modify the colour palette: {{$:/core/ui/Buttons/palette}}
* Experiment with the <$button actions=<<openCpTheme>> class="tc-btn-invisible"><<.icon $:/core/images/options-button>> ~ControlPanel</$button>

! Work with Stylesheets

Expand Down Expand Up @@ -73,3 +73,7 @@ A stylesheet tiddler is processed such that it is first wikified and then the te
!! Stylesheet Macros

The ~TiddlyWiki core provides several [[global macros that are helpful in constructing stylesheets|Stylesheet Macros]].

!! See Also

* <<list-links "[tag[Using Stylesheets]]">>
14 changes: 14 additions & 0 deletions editions/tw5.com/tiddlers/images/Icon Gallery.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
created: 20211013132515594
modified: 20211018102307833
tags: Learning
title: Icon Gallery
type: text/vnd.tiddlywiki

\define copyActions() <$action-sendmessage $message="tm-copy-to-clipboard" $param=<<imageTitle>>/>

<<.tip "Click an icon to copy the title to the clipboard">>

<div class="tc-image-chooser">
<$macrocall $name="image-picker-list" filter="[all[shadows+tiddlers]tag[$:/tags/Image]]" actions=<<copyActions>> />
</div>

Binary file modified editions/tw5.com/tiddlers/images/New Release Banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions editions/tw5.com/tiddlers/languages/LanguageGallery.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20151231083708980
modified: 20151231084132703
tags:
modified: 20211117212723856
tags: Languages
title: LanguageGallery Example
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20160418154853776
modified: 20160418155450547
tags:
modified: 20211116034610950
tags: [[Macro Examples]]
title: colour-picker Macro (Example 1)
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20160418155523369
modified: 20160418155913663
tags:
modified: 20211116035014728
tags: [[Macro Examples]]
title: image-picker Macro (Example 1)
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20160418155523369
modified: 20160418155913663
tags:
modified: 20211116035110986
tags: [[Macro Examples]]
title: image-picker Macro (Example 2)
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20210227212730299
modified: 20210427184057456
tags:
modified: 20211118025545823
tags: [[Macro Examples]]
title: unusedtitle Macro (Examples 1)
type: text/vnd.tiddlywiki

Expand Down
4 changes: 2 additions & 2 deletions editions/tw5.com/tiddlers/mechanisms/RefreshThrottling.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20191013095916159
modified: 20210203231820284
tags: RefreshMechanism
modified: 20211117232644028
tags: RefreshMechanism Mechanisms
title: RefreshThrottling
type: text/vnd.tiddlywiki

Expand Down
4 changes: 2 additions & 2 deletions editions/tw5.com/tiddlers/mechanisms/StateMechanism.tid
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
created: 20131228164411884
modified: 20150221225557000
modified: 20211127033939415
tags: Mechanisms
title: StateMechanism
type: text/vnd.tiddlywiki
Expand All @@ -17,7 +17,7 @@ The stack of templates that make up the TiddlyWiki display are complex but we'll
Breaking down the attributes applied to the list widget:

* ''filter'': selects the list of tiddlers in the `list` field of the tiddler [[$:/StoryList]]. If a tiddler is added or removed from that list then it is automatically reflected in the displayed list
* ''history'': references the tiddler to be used to store the history stack (see the NavigationMechanism)
* ''history'': references the tiddler to be used to store the history stack (see the HistoryMechanism)
* ''template'': identifies a template tiddler to be used for rendering each tiddler in the list
* ''editTemplate'': identifies a different template tiddler to be used for rendering tiddlers that are in [[draft mode|DraftMechanism]]
* ''storyview'': specifies the story view to be used (eg classic, or zoomin)
Expand Down
3 changes: 2 additions & 1 deletion editions/tw5.com/tiddlers/messages/SampleModal.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
created: 20140912145537860
footer: <$button message="tm-close-tiddler">Close</$button>
modified: 20140912145537861
modified: 20211117224341543
subtitle: This is a modal created especially for <<yourName>>
tags: [[Message Examples]]
title: SampleModal
type: text/vnd.tiddlywiki

Expand Down
10 changes: 10 additions & 0 deletions editions/tw5.com/tiddlers/messages/SampleWindowTemplate.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
created: 20211109165213041
modified: 20211117224321325
tags: [[Message Examples]]
title: SampleWindowTemplate


| ''Name:'' |<$edit field=name tag="input" />|
|''Rank:'' |<$edit field=rank tag="input" />|

''Variable 'something' contains:''<<something>>
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ Inserts the text specified in <<.param "text">> at the caret position. If there
</div>
\end

\define focusEditorDescription() Simply focuses the Text Editor

A `tm-edit-text-operation` invokes one of the available operations on a __surrounding__ text editor. Therefore the message has to be dispatched within the editor in order for it to catch it. The following properties on the `event` object are required:

|!Name |!Description |
Expand All @@ -137,6 +139,7 @@ At this point the following text operations have been implemented:
|<<.def "save-selection">>|<<saveSelectionDescription>> |
|<<.def "make-link">>|<<makeLinkDescription>> |
|<<.def "insert-text">>|<<insertTextDescription>>|
|<<.def "focus-editor">>|<<.from-version 5.2.0>> <<focusEditorDescription>> |


!Example
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
caption: tm-open-window
created: 20160424181447704
modified: 20190704145627537
modified: 20211117042202771
tags: Messages
title: WidgetMessage: tm-open-window
type: text/vnd.tiddlywiki

The `tm-open-window` message opens a tiddler in a new //browser// window. If no parameters are specified, the current tiddler is opened in a new window. Similiar to `tm-modal` any additional parameters passed via the <<.param "paramObject">> are being provided as variables to the new window.
The `tm-open-window` [[message|Message]] opens a tiddler in a new //browser// window. If no parameters are specified, the current tiddler is opened in a new window. Similiar to `tm-modal` any additional parameters passed via the <<.param "paramObject">> are provided as variables to the new window.

|!Name |!Description |
|param |Title of the tiddler to be opened in a new browser window, defaults to <<.var "currentTiddler">> if empty |
|template |Template in which the tiddler will be rendered in |
|windowTitle |Title string for the opened window |
|width |Width of the new browser window |
|height |Height of the new browser window |
|paramObject |Hashmap of variables that will be provided to the window |
|paramObject |Hashmap of variables to be provided to the modal, contains all extra parameters passed to the widget sending the message. |

The `tm-open-window` message is best generated with the ActionSendMessageWidget, which in turn is triggered by a widget such as the ButtonWidget. It is handled by the core itself.

<<.tip """When used with the ActionSendMessage Widget, <<.param 'param'>> becomes <<.param '$param'>> """>>
<<.tip """Parameters <<.param template>>, <<.param windowTitle>>, <<.param width>>, and <<.param height>> require the ActionSendMessageWidget.""">>


<$macrocall $name='wikitext-example-without-html'
src="""
<$button>Open Window
<$action-sendmessage
$message="tm-open-window"
$param="$:/temp/openme"
template="SampleWindowTemplate"
windowTitle="My Window Title"
width="100em"
height="50em"
something="I just in over in a variable, and boy is my Hashmap tired." />
</$button>
""" />

The `tm-open-window` message is usually generated with the ButtonWidget and is handled by the core itself.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
created: 20140617211749290
modified: 20140912141809800
modified: 20211104172343220
tags: [[TiddlyWiki on Node.js]]
title: Environment Variables on Node.js
type: text/vnd.tiddlywiki
Expand All @@ -11,7 +11,9 @@ type: text/vnd.tiddlywiki
* `TIDDLYWIKI_LANGUAGE_PATH` - Search path for languages
* `TIDDLYWIKI_EDITION_PATH` - Search path for editions (used by the InitCommand)

''Note'': The delimiter may vary between operating systems. While on Windows a semicolon `;` is used, Linux implements a colon `:`.
''Note 1'': The delimiter may vary between operating systems. While on Windows a semicolon `;` is used, Linux implements a colon `:`.

''Note 2'': On Linux systems, it may be necessary to //''export''// the variable as well as to define it.

The additional paths should each point to folders structured like the equivalent directories in the TiddlyWiki5 GitHub repository: the plugin, theme and language directories contain `publisher/pluginname/<files>` while the edition directories contain `editionname/<files>`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@ created: 20131219100608529
delivery: DIY
description: Flexible hosting on your own machine or in the cloud
method: sync
modified: 20200507110222866
modified: 20211003230831173
tags: Saving [[TiddlyWiki on Node.js]] Windows Mac Linux
title: Installing TiddlyWiki on Node.js
type: text/vnd.tiddlywiki

# Install [[Node.js]]
#* either from your favourite package manager: typically `apt-get install nodejs` on Debian/Ubuntu Linux or [[Termux for Android|Serving TW5 from Android]], or `brew install node` on a Mac
#* or directly from http://nodejs.org
#* Linux:
#*> //Debian/Ubuntu//:<br/>`apt install nodejs`<br/>May need to be followed up by:<br/>`apt install npm`
#*> //Arch Linux//<br/>`pacman -S tiddlywiki` <br/>(installs node and tiddlywiki)
#* Mac
#*> `brew install node`
#* Android
#*> [[Termux for Android|Serving TW5 from Android]]
#* Other
#*> See http://nodejs.org
# Open a command line terminal and type:
#> `npm install -g tiddlywiki`
#> If it fails with an error you may need to re-run the command as an administrator:
Expand Down
11 changes: 6 additions & 5 deletions editions/tw5.com/tiddlers/nodejs/tiddlywiki.files_Files.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20161015114118243
modified: 20201201000000000
tags: TiddlyWikiFolders
modified: 20211114101256212
tags: TiddlyWikiFolders [[TiddlyWiki on Node.js]]
title: tiddlywiki.files Files
type: text/vnd.tiddlywiki

Expand Down Expand Up @@ -48,13 +48,14 @@ Directory specifications in the `directories` array may take the following forms

* a ''string'' literal, specifying the absolute or relative path to the directory containing the tiddler files (relative paths are interpreted relative to the path of the `tiddlywiki.files` file). The directory is recursively searched for tiddler files
* <<.from-version "5.1.14">> an ''object'' with the following properties:
** ''path'' - (required) the absolute or relative path to the directory containing the tiddler files (relative paths are interpreted relative to the path of the `tiddlywiki.files` file). Note that the directory is not recursively searched; sub-directories are ignored
** ''path'' - (required) the absolute or relative path to the directory containing the tiddler files (relative paths are interpreted relative to the path of the `tiddlywiki.files` file). Note that by default the directory is not recursively searched; sub-directories are ignored unless the //searchSubdirectories// flag is set to `true` (see below).
** ''filesRegExp'' - (optional) a [[regular expression|https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions]] that matches the filenames of the files that should be processed within the directory
** ''isTiddlerFile'' - (required) if `true`, the file will be treated as a [[tiddler file|TiddlerFiles]] and deserialised to extract the tiddlers. Otherwise, the raw content of the file is assigned to the `text` field without any parsing
** ''isEditableFile'' - (optional) if `true`, changes to the tiddler be saved back to the original file. The tiddler will be saved back to the original filepath as long as it does not generate a result from the $:/config/FileSystemPath filters, which will override the final filepath generated if a result is returned from a filter. <<.from-version "5.1.23">>
** ''isEditableFile'' - <<.from-version "5.1.23">> (optional) if `true`, changes to the tiddler be saved back to the original file. The tiddler will be saved back to the original filepath as long as it does not generate a result from the $:/config/FileSystemPath filters, which will override the final filepath generated if a result is returned from a filter.
** ''searchSubdirectories'' - <<.from-version "5.1.23">> (optional) if `true`, all subdirectories of the //path// are searched recursively for files that match the (optional) //filesRegExp//. If no //filesRegExp// is provided, all files in all subdirectoies of the //path// are loaded. Tiddler titles generated via a //source// attribute (see above) will only include the filename, not any of the subdirectories of the path. If this results in multiple files with loaded with the same tiddler title, then only the last file loaded under that tiddler title will be in memory. In order to prevent this, you must have multiple directory objects listed and customize the title field with a //prefix// or //suffix// alongside the //source// attribute.
** ''fields'' - (required) an object containing values that override or customise the fields provided in the tiddler file (see above)

Fields can be overridden for particular files by creating a file with the same name plus the suffix `.meta` -- see TiddlerFiles.
Fields can also be overridden for particular files by creating a file with the same name plus the suffix `.meta` -- see TiddlerFiles.

! Examples

Expand Down
4 changes: 2 additions & 2 deletions editions/tw5.com/tiddlers/nodejs/tiddlywiki.info_Files.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20161015114042793
modified: 20161015121622327
tags: TiddlyWikiFolders
modified: 20211114101249016
tags: TiddlyWikiFolders [[TiddlyWiki on Node.js]]
title: tiddlywiki.info Files
type: text/vnd.tiddlywiki

Expand Down
4 changes: 2 additions & 2 deletions editions/tw5.com/tiddlers/platforms/TiddlyFox Apocalypse.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20171109170823847
modified: 20171113161750857
tags: Platforms
modified: 20211124214943222
tags: TiddlyFox
title: TiddlyFox Apocalypse
type: text/vnd.tiddlywiki

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
created: 20131129100250644
modified: 20150412185535373
tags: [[Hosting your TiddlyWiki on the web]] Platforms
modified: 20211124214855770
tags: $:/deprecated
title: TiddlyWiki in the Sky for TiddlyWeb
type: text/vnd.tiddlywiki

TiddlyWiki in the Sky for TiddlyWeb allows content to be synchronised between TiddlyWiki running in the browser and a TiddlyWeb server. Features include:

* Lazy loading
* Two way synchronisation between the browser and the server
** Synchronising from the server is accomplished by polling (currently every 60 seconds)
* Throttling so that rapidly changing tiddlers don't overwhelm the server
The term "TiddlyWiki in the Sky for TiddlyWeb" was used to refer to the ability for content to be synchronised between TiddlyWiki running in the browser and a TiddlyWeb server. This configuration should still work but is no longer commonly used.
4 changes: 2 additions & 2 deletions editions/tw5.com/tiddlers/plugins/Plugin Types.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20190928081810311
modified: 20190928103750812
tags:
modified: 20211114222640985
tags: PluginMechanism
title: Plugin Types
type: text/vnd.tiddlywiki

Expand Down
1 change: 1 addition & 0 deletions editions/tw5.com/tiddlers/reference/Reference.tid
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ modified: 20180927080640647
tags: TableOfContents
title: Reference
type: text/vnd.tiddlywiki
color: #F45757

The following topics provide the canonical reference documentation for TiddlyWiki:

Expand Down
4 changes: 2 additions & 2 deletions editions/tw5.com/tiddlers/releasenotes/BetaReleases.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20131109105400007
modified: 20141010092837891
tags: Releases
modified: 20211117230125737
tags: Releases BetaReleaseNotes
title: BetaReleases
type: text/vnd.tiddlywiki

Expand Down
Loading