| 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. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| 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. |
| 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: 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]] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,11 @@ | ||
| created: 20140809113603449 | ||
| modified: 20211022195248529 | ||
| tags: Learning | ||
| title: ImageGallery Example | ||
| type: text/vnd.tiddlywiki | ||
|
|
||
| <<.warning "The [[ImageGallery Example]] has been replaced with the new [[Icon Gallery]] which is transcluded below">> | ||
|
|
||
| --- | ||
|
|
||
| {{Icon Gallery}} |
| 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: 20211123034440629 | ||
| tags: KeyboardDrivenInput | ||
| title: kdi-demo-configtid | ||
| type: text/vnd.tiddlywiki | ||
|
|
| 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 | ||
|
|
||
| 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 | ||
|
|
||
| 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 | ||
|
|
||
| This tiddler SampleTiddlerThird is the third test tiddler. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| created: 20150221194324000 | ||
| 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 | ||
| 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: 20211114013601187 | ||
| tags: First [[Table-of-Contents Demonstrations]] | ||
| title: FirstOne | ||
|
|
||
| <<.toc-lorem>> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| created: 20150221194357000 | ||
| modified: 20211114013601187 | ||
| tags: First [[Table-of-Contents Demonstrations]] | ||
| title: FirstThree | ||
|
|
||
| <<.toc-lorem>> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| created: 20150221194401000 | ||
| modified: 20211114013601187 | ||
| tags: First [[Table-of-Contents Demonstrations]] | ||
| title: FirstTwo | ||
|
|
||
| <<.toc-lorem>> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| created: 20150221194405000 | ||
| modified: 20211114013601188 | ||
| tags: Contents [[Table-of-Contents Demonstrations]] | ||
| title: Fourth | ||
|
|
||
| <<.toc-lorem>> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| created: 20150221194408000 | ||
| modified: 20211114013601190 | ||
| tags: Contents [[Table-of-Contents Demonstrations]] | ||
| title: Second | ||
|
|
||
| <<.toc-lorem>> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| created: 20150221194412000 | ||
| modified: 20211114013601188 | ||
| tags: Second [[Table-of-Contents Demonstrations]] | ||
| title: SecondOne | ||
|
|
||
| <<.toc-lorem>> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| created: 20150221194416000 | ||
| 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: 20211114013601188 | ||
| tags: SecondThree [[Table-of-Contents Demonstrations]] | ||
| title: SecondThreeOne | ||
|
|
||
| <<.toc-lorem>> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| created: 20150221194423000 | ||
| modified: 20211114013601189 | ||
| tags: SecondThree [[Table-of-Contents Demonstrations]] | ||
| title: SecondThreeThree | ||
|
|
||
| <<.toc-lorem>> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| created: 20150221194429000 | ||
| modified: 20211114013601189 | ||
| tags: SecondThree [[Table-of-Contents Demonstrations]] | ||
| title: SecondThreeTwo | ||
|
|
||
| <<.toc-lorem>> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| created: 20150221194433000 | ||
| modified: 20211114013601190 | ||
| tags: Second [[Table-of-Contents Demonstrations]] | ||
| title: SecondTwo | ||
|
|
||
| <<.toc-lorem>> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| created: 20150221194436000 | ||
| 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: 20211114013601190 | ||
| tags: Third [[Table-of-Contents Demonstrations]] | ||
| title: ThirdOne | ||
|
|
||
| <<.toc-lorem>> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| created: 20150221194446000 | ||
| modified: 20211114013601190 | ||
| tags: Third [[Table-of-Contents Demonstrations]] | ||
| title: ThirdThree | ||
|
|
||
| <<.toc-lorem>> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| created: 20150221194453000 | ||
| modified: 20211114013601191 | ||
| tags: Third [[Table-of-Contents Demonstrations]] | ||
| title: ThirdTwo | ||
|
|
||
| <<.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 | ||
|
|
||
| This tiddler exists to demonstrate the <<.mlink tag>> macro. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| 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: 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: 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: 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: 20130825143100000 | ||
| modified: 20211115013200231 | ||
| tags: task TaskManagementExample | ||
| title: Make the beds | ||
|
|
||
| //This is a sample task for the TaskManagementExample// |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| color: #2dbe37 | ||
| created: 20211115013354157 | ||
| icon: $:/core/images/done-button | ||
| modified: 20211115013357660 | ||
| tags: TaskManagementExample | ||
| title: done | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| color: #8d9ac3 | ||
| created: 20130825213200000 | ||
| list: [[Make the beds]] | ||
| 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,3 +1,6 @@ | ||
| created: 20211117214646420 | ||
| modified: 20211117214650773 | ||
| tags: [[Widget Examples]] | ||
| title: sampletag1 | ||
|
|
||
| This is `sampletag1`. |
| 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`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,9 @@ | ||
| created: 20130822173400000 | ||
| 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 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. |
| 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">> |
| 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">> |
| 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">> |
| 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">> |
| 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 |
|---|---|---|
| @@ -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 |
|---|---|---|
| @@ -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: 20211030223407188 | ||
| tags: [[subfilter Operator]] [[Operator Examples]] | ||
| title: subfilter Operator (Examples) | ||
| type: text/vnd.tiddlywiki | ||
|
|
||
| \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]]">> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,17 @@ | ||
| caption: nth | ||
| 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-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">> |
| 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">> |
| 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 |
|---|---|---|
| @@ -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: 20211129032537195 | ||
| tags: [[Filter Syntax]] [[Filter Run Prefix Examples]] | ||
| title: Filter Run Prefix (Examples) | ||
| type: text/vnd.tiddlywiki | ||
|
|
||
| !! `:filter` examples | ||
|
|
||
| See [[Filter Filter Run Prefix (Examples)]] | ||
|
|
||
| !! `:intersection` examples | ||
|
|
||
| See [[Intersection Filter Run Prefix (Examples)]] | ||
|
|
||
| !! `:reduce` examples | ||
|
|
||
| See [[Reduce Filter Run Prefix (Examples)]] | ||
|
|
||
| !! `:sort` 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 |
|---|---|---|
| @@ -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)]] |
| 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">> |
| 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,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 |
|---|---|---|
| @@ -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 |
|---|---|---|
| @@ -1,44 +1,32 @@ | ||
| created: 20140214215718317 | ||
| 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|Story River]]. The NavigatorWidget and ListWidget work together to: | ||
|
|
||
| # 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! | ||
|
|
||
| Here is the example code (see also StateMechanism for related discussion): | ||
|
|
||
| <$macrocall $name='wikitext-example-without-html' | ||
| src='<$navigator story="$:/temp/DemoStoryList" history="$:/temp/DemoHistoryList"> | ||
|
|
||
| {{$:/core/ui/SideBarSegments/search}} | ||
|
|
||
| <$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>"/> | ||
|
|
||
| </$navigator>'> |
| 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 |
|---|---|---|
| @@ -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> | ||
|
|
| 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 |
|---|---|---|
| @@ -1,19 +1,37 @@ | ||
| caption: tm-open-window | ||
| created: 20160424181447704 | ||
| modified: 20211117042202771 | ||
| tags: Messages | ||
| title: WidgetMessage: tm-open-window | ||
| type: text/vnd.tiddlywiki | ||
|
|
||
| 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 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> | ||
| """ /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,7 @@ | ||
| created: 20131129100250644 | ||
| modified: 20211124214855770 | ||
| tags: $:/deprecated | ||
| title: TiddlyWiki in the Sky for TiddlyWeb | ||
| type: text/vnd.tiddlywiki | ||
|
|
||
| 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. |