1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-29 16:53:14 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/filters/examples/lookup Operator (Examples).tid
Joshua Fontany 1d0af90ba2
Extend lookup operator to work with fields and indexes (#5742)
* extend lookup op flexibility with 2 parameters

* bumped .from macro to .24

* aligned syntax

* lookup fixes

* bugfix

* docs

* messed up the tests somehow

* docs fix

* lookup bugfix

* docs

* docs

* call self.displayError

* Revert "call self.displayError"

This reverts commit 5d599aa979.

* storylist

* tests

* tests pass
2022-02-21 09:48:29 +00:00

14 lines
1.5 KiB
Plaintext

created: 20170907144257037
modified: 20211118025451349
tags: [[Operator Examples]]
title: lookup Operator (Examples)
type: text/vnd.tiddlywiki
<<.operator-example 1 "[all[shadows+tiddlers]tag[$:/tags/PageControls]lookup[$:/config/PageControlButtons/Visibility/]]" "Retrieve the visibility status of each page control button">>
<<.operator-example 2 "[all[shadows+tiddlers]tag[$:/tags/PageControls]lookup:show[$:/config/PageControlButtons/Visibility/]]" "Retrieve the visibility status of each page control button, this time with a default value">>
<<.operator-example 3 "[all[tiddlers]has[plugin-type]removeprefix[$:/plugins/tiddlywiki/]lookup:missing-description:field[$:/plugins/tiddlywiki/],[description]]" "Retrieve the description of all plugin-tiddlers that are in the `$:/plugins/tiddlywiki/` namespace.">>
<<.operator-example 4 "OriginalTiddlerPaths +[lookup:missing-index:index[$:/config/],[HelloThere]]" "Lookup the original tiddler path on disk for the [[Hello There]] tiddler.">>
<<.operator-example 5 "OriginalTiddlerPaths +[lookup:missing-index:index[$:/config/],[MissingTiddler]]" "Lookup the original tiddler path on disk for the [[MissingTiddler]] tiddler.">>
<<.operator-example 6 "HistoryList MissingHistoryList +[lookup:missing-0:index[$:/]]" "Retrieve index `0` from the `$:/HistoryList` and `$:/MissingHistoryList`.">>
<<.operator-example 7 "OriginalTiddlerPaths MissingTiddlerPaths +[lookup:missing-tiddler:index[$:/config/],[$:/key-test]]" "Retrieve index `$:/key-test` from `$:/config/OriginalTiddlerPaths` and `$:/config/MissingTiddlerPaths`.">>