From 49894abaf4c7f8e1f91300dfe6e9d71cef132e60 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 18 Oct 2015 18:37:08 +0200 Subject: [PATCH 01/33] Create x-listops.js These filters are designed to be used with the action-listops widget. --- core/modules/filters/x-listops.js | 170 ++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 core/modules/filters/x-listops.js diff --git a/core/modules/filters/x-listops.js b/core/modules/filters/x-listops.js new file mode 100644 index 000000000..9b61a8aef --- /dev/null +++ b/core/modules/filters/x-listops.js @@ -0,0 +1,170 @@ +/*\ +title: $:/core/modules/filters/x-listops.js +type: application/javascript +module-type: filteroperator + +Extended filter operators to manipulate the current list. + +\*/ +(function () { + + /*jslint node: true, browser: true */ + /*global $tw: false */ + "use strict"; + + var prepare_results = function (source) { + var results = []; + source(function (tiddler, title) { + results.push(title); + }); + return results; + }; + + /* + Moves a number of items from the tail of the current list before the item named in the operand + */ + exports.putbefore = function (source, operator, options) { + var results = prepare_results(source), + index = results.indexOf(operator.operand), + count = parseInt(operator.suffix) || 1; + if (index === -1) { + return results.slice(0, -1); + } + return results.slice(0, index).concat(results.slice(-count)).concat(results.slice(index, -count)); + }; + + /* + Moves a number of items from the tail of the current list after the item named in the operand + */ + exports.putafter = function (source, operator, options) { + var results = prepare_results(source), + index = results.indexOf(operator.operand), + count = parseInt(operator.suffix) || 1; + if (index === -1) { + return results.slice(0, -1); + } + return results.slice(0, index + 1).concat(results.slice(-count)).concat(results.slice(index + 1, -count)); + }; + + /* + Replaces the item named in the operand with a number of items from the tail of the current list + */ + exports.replace = function (source, operator, options) { + var results = prepare_results(source), + index = results.indexOf(operator.operand), + count = parseInt(operator.suffix) || 1; + if (index === -1) { + return results.slice(0, -count); + } + return results.slice(0, index).concat(results.slice(-count)).concat(results.slice(index + 1, -count)); + }; + + /* + Moves a number of items from the tail of the current list to the head of the list + */ + exports.putfirst = function (source, operator, options) { + var results = prepare_results(source), + count = parseInt(operator.suffix) || 1; + return results.slice(-count).concat(results.slice(0, -count)); + }; + + /* + Moves a number of items from the head of the current list to the tail of the list + */ + exports.putlast = function (source, operator, options) { + var results = prepare_results(source), + count = parseInt(operator.suffix) || 1; + return results.slice(count).concat(results.slice(0, count)); + }; + + /* + Returns the items from the current list that are after the item named in the operand + */ + exports.allafter = function (source, operator, options) { + var results = prepare_results(source), + index = results.indexOf(operator.operand); + if (index === -1 || index > (results.length - 2)) { + return []; + } + if (operator.suffix) { + return results.slice(index - 1); + } + return results.slice(index); + }; + + /* + Returns the items from the current list that are before the item named in the operand + */ + exports.allbefore = function (source, operator, options) { + var results = prepare_results(source), + index = results.indexOf(operator.operand); + if (index <= 0) { + return []; + } + if (operator.suffix) { + return results.slice(0, index + 1); + } + return results.slice(0, index); + }; + + /* + Appends the items listed in the operand array to the tail of the current list + */ + exports.append = function (source, operator, options) { + var results = prepare_results(source), + append = $tw.utils.parseStringArray(operator.operand); + if (append === "") { + return results; + } + return results.concat(append); + }; + + /* + Prepends the items listed in the operand array to the head of the current list + */ + exports.prepend = function (source, operator, options) { + var results = prepare_results(source), + prepend = $tw.utils.parseStringArray(operator.operand); + if (prepend === "") { + return results; + } + return prepend.concat(results); + }; + + /* + Returns all items from the current list except the items listed in the operand array + */ + exports.remove = function (source, operator, options) { + var results = prepare_results(source), + count = parseInt(operator.suffix) || 1, + p, len, index, array = $tw.utils.parseStringArray(operator.operand); + len = array.length - 1; + for (p = 0; p < count; ++p) { + if (operator.prefix) { + index = results.indexOf(array[len - p]); + } else { + index = results.indexOf(array[p]); + } + if (index !== -1) { + results.splice(index, 1); + } + } + return results; + }; + + /* + Returns all items from the current list sorted in the order of the items in the operand array + */ + exports.sortby = function (source, operator, options) { + var results = prepare_results(source); + if (!results || results.length < 2) { + return results; + } + var lookup = $tw.utils.parseStringArray(operator.operand); + results.sort(function (a, b) { + return lookup.indexOf(a) - lookup.indexOf(b); + }); + return results; + }; + +})(); From 56d467fb47cc169c2f63ea5e88fe372aec8db2cf Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 18 Oct 2015 18:41:40 +0200 Subject: [PATCH 02/33] Create action-listops.js Action widget designed to apply filters to the current list and save the modified list back to the list. The widget is able to manipulate lists in any field or any data index of the target tiddler, and includes an option to manipulate the tags of the target tiddler. The widget is used in conjunction with the extended list operator filters (xlistops.js) --- core/modules/widgets/action-listops.js | 89 ++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 core/modules/widgets/action-listops.js diff --git a/core/modules/widgets/action-listops.js b/core/modules/widgets/action-listops.js new file mode 100644 index 000000000..c88130b39 --- /dev/null +++ b/core/modules/widgets/action-listops.js @@ -0,0 +1,89 @@ +/*\ +title: $:/core/modules/widgets/action-listops.js +type: application/javascript +module-type: widget + +Action widget to apply list operations to any tiddler field (defaults to the 'tags' field of the current tiddler) + +\*/ +(function () { + + /*jslint node: true, browser: true */ + /*global $tw: false */ + "use strict"; + + var Widget = require("$:/core/modules/widgets/widget.js").widget; + + var ActionListopsWidget = function (parseTreeNode, options) { + this.initialise(parseTreeNode, options); + }; + + /* + Inherit from the base widget class + */ + ActionListopsWidget.prototype = new Widget(); + + /* + Render this widget into the DOM + */ + ActionListopsWidget.prototype.render = function (parent, nextSibling) { + this.computeAttributes(); + this.execute(); + }; + + /* + Compute the internal state of the widget + */ + ActionListopsWidget.prototype.execute = function () { + // Get our parameters + this.target = this.getAttribute("$tiddler", this.getVariable("currentTiddler")); + this.filter = this.getAttribute("$filter"); + this.subfilter = this.getAttribute("$subfilter"); + this.listField = this.getAttribute("$list", "list"); + this.listIndex = this.getAttribute("$index"); + this.filtertags = this.getAttribute("$tags"); + }; + + /* + Refresh the widget by ensuring our attributes are up to date + */ + ActionListopsWidget.prototype.refresh = function (changedTiddlers) { + var changedAttributes = this.computeAttributes(); + if (changedAttributes.$tiddler || changedAttributes.$filter || changedAttributes.$subfilter || changedAttributes.$list || changedAttributes.$index || changedAttributes.$tags) { + this.refreshSelf(); + return true; + } + return this.refreshChildren(changedTiddlers); + }; + + /* + Invoke the action associated with this widget + */ + ActionListopsWidget.prototype.invokeAction = function (triggeringWidget, event) { + //try this + var field = this.listField, + index = undefined, + type = "!!", + list = this.listField; + if (this.listIndex) { + field = undefined; + index = this.listIndex; type = "##"; + list = this.listIndex; + } + if (this.filter) { + this.wiki.setText(this.target, field, index, $tw.utils.stringifyList(this.wiki.filterTiddlers(this.filter, this))); + } + if (this.subfilter) { + var subfilter = "[list[" + this.target + type + list + "]] " + this.subfilter; + this.wiki.setText(this.target, field, index, $tw.utils.stringifyList(this.wiki.filterTiddlers(subfilter, this))); + } + if (this.filtertags) { + var tagfilter = "[list[" + this.target + "!!tags]] " + this.filtertags; + this.wiki.setText(this.target, "tags", undefined, $tw.utils.stringifyList(this.wiki.filterTiddlers(tagfilter, this))); + } + return true; // Action was invoked + }; + + exports["action-listops"] = ActionListopsWidget; + +})(); From 3e445b8853aecfeeefa3626800c06ce0ba3f807a Mon Sep 17 00:00:00 2001 From: William Jackson Date: Thu, 22 Oct 2015 16:40:36 +0200 Subject: [PATCH 03/33] Update x-listops.js Corrected the logic of the 'allafter' filter and added a new 'move' filter. --- core/modules/filters/x-listops.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/core/modules/filters/x-listops.js b/core/modules/filters/x-listops.js index 9b61a8aef..f6fde4ee0 100644 --- a/core/modules/filters/x-listops.js +++ b/core/modules/filters/x-listops.js @@ -77,6 +77,17 @@ Extended filter operators to manipulate the current list. return results.slice(count).concat(results.slice(0, count)); }; +/* + Moves the item named in the operand a number of places forward or backward in the list + */ + exports.move = function (source, operator, options) { + var results = prepare_results(source), + index = results.indexOf(operator.operand), + count = parseInt(operator.suffix) || 1, + marker = results.splice(index, 1); + return results.slice(0, index + count).concat(marker).concat(results.slice(index + count)); + }; + /* Returns the items from the current list that are after the item named in the operand */ @@ -87,9 +98,9 @@ Extended filter operators to manipulate the current list. return []; } if (operator.suffix) { - return results.slice(index - 1); + return results.slice(index); } - return results.slice(index); + return results.slice(index + 1); }; /* From 817882a4042e6d8d84ba509f2d49d84829c66ceb Mon Sep 17 00:00:00 2001 From: William Jackson Date: Tue, 27 Oct 2015 10:17:07 +0200 Subject: [PATCH 04/33] Update x-listops.js Added prefix and suffix options to 'append' and 'prepend' operators --- core/modules/filters/x-listops.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/modules/filters/x-listops.js b/core/modules/filters/x-listops.js index f6fde4ee0..8b66a24c6 100644 --- a/core/modules/filters/x-listops.js +++ b/core/modules/filters/x-listops.js @@ -123,11 +123,16 @@ Extended filter operators to manipulate the current list. */ exports.append = function (source, operator, options) { var results = prepare_results(source), + count = parseInt(operator.suffix) || 1, append = $tw.utils.parseStringArray(operator.operand); if (append === "") { return results; } - return results.concat(append); + if (operator.prefix) { + return results.concat(append.slice(-count)); + } else { + return results.concat(append.slice(0, count)); + } }; /* @@ -135,11 +140,16 @@ Extended filter operators to manipulate the current list. */ exports.prepend = function (source, operator, options) { var results = prepare_results(source), + count = parseInt(operator.suffix) || 1, prepend = $tw.utils.parseStringArray(operator.operand); if (prepend === "") { return results; } - return prepend.concat(results); + if (operator.prefix) { + return prepend.slice(-count).concat(results); + } else { + return prepend.slice(0, count).concat(results); + } }; /* From befb13dde11cebf339b7d8baa1e56b3640524e41 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 09:49:07 +0200 Subject: [PATCH 05/33] Update x-listops.js Change default suffix for append[], prepend[] and remove[] operators from 1 to All --- core/modules/filters/x-listops.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/core/modules/filters/x-listops.js b/core/modules/filters/x-listops.js index 8b66a24c6..63edcd142 100644 --- a/core/modules/filters/x-listops.js +++ b/core/modules/filters/x-listops.js @@ -122,10 +122,10 @@ Extended filter operators to manipulate the current list. Appends the items listed in the operand array to the tail of the current list */ exports.append = function (source, operator, options) { - var results = prepare_results(source), - count = parseInt(operator.suffix) || 1, - append = $tw.utils.parseStringArray(operator.operand); - if (append === "") { + var append = $tw.utils.parseStringArray(operator.operand), + results = prepare_results(source), + count = parseInt(operator.suffix) || append.length; + if (append.length === 0) { return results; } if (operator.prefix) { @@ -139,10 +139,10 @@ Extended filter operators to manipulate the current list. Prepends the items listed in the operand array to the head of the current list */ exports.prepend = function (source, operator, options) { - var results = prepare_results(source), - count = parseInt(operator.suffix) || 1, - prepend = $tw.utils.parseStringArray(operator.operand); - if (prepend === "") { + var prepend = $tw.utils.parseStringArray(operator.operand), + results = prepare_results(source), + count = parseInt(operator.suffix) || prepend.length; + if (prepend.length === 0) { return results; } if (operator.prefix) { @@ -156,9 +156,10 @@ Extended filter operators to manipulate the current list. Returns all items from the current list except the items listed in the operand array */ exports.remove = function (source, operator, options) { - var results = prepare_results(source), - count = parseInt(operator.suffix) || 1, - p, len, index, array = $tw.utils.parseStringArray(operator.operand); + var array = $tw.utils.parseStringArray(operator.operand), + results = prepare_results(source), + count = parseInt(operator.suffix) || array.length, + p, len, index; len = array.length - 1; for (p = 0; p < count; ++p) { if (operator.prefix) { From ac9aa78859c05e9466d7fd642176fbbb6b5d67c1 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 09:56:37 +0200 Subject: [PATCH 06/33] Create ActionListopsWidget.tid Primary documentation for ActionListops widget --- .../tiddlers/widgets/ActionListopsWidget.tid | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 editions/tw5.com/tiddlers/widgets/ActionListopsWidget.tid diff --git a/editions/tw5.com/tiddlers/widgets/ActionListopsWidget.tid b/editions/tw5.com/tiddlers/widgets/ActionListopsWidget.tid new file mode 100644 index 000000000..926a21f15 --- /dev/null +++ b/editions/tw5.com/tiddlers/widgets/ActionListopsWidget.tid @@ -0,0 +1,128 @@ +caption: action-listops +created: 20141025120850184 +creator: matabele +modified: 20151108075247352 +modifier: matabele +myfield: +revision: 0 +tags: ActionWidgets Widgets +title: ActionListopsWidget +type: text/vnd.tiddlywiki + +\define .operator-rows(filter) +<$list filter="$filter$"> +<$link to={{!!title}}>{{!!caption}} +{{!!op-purpose}} <$list filter="[all[current]tag[Common Operators]]">{{$:/core/images/done-button}} +<$list filter="[all[current]tag[Negatable Operators]]">`!` + +\end + +\define .group-heading(_) +$_$ +\end + +! Introduction + +The ''action-listops'' widget is an [[action widget|ActionWidgets]] that manipulates user lists in any field or data index. ActionWidgets are used within triggering widgets such as the ButtonWidget. + +! Content and Attributes + +The ''action-listops'' widget is invisible. Any content within it is ignored. + +|!Attribute |!Description | +|$tiddler |The title of the tiddler whose lists are to be modified (if not provided defaults to the [[current tiddler|Current Tiddler]] | +|$list |The name of a field to be manipulated as a list (defaults to 'list') | +|$index |Optional index of a property in a [[data tiddler|DataTiddlers]] index to be manipulated as a list | +|$filter |An optional filter expression, the output of which will be saved to the field/index being manipulated | +|$subfilter |An optional subfilter expression, which takes the list being manipulated as input, and saves the modified list back to the field/index being manipulated | +|$tags |An optional subfilter expression, which takes the 'tags' field of the target tiddler as input, and saves the modified list of tags back to the 'tags' field | + +! Extended Filter Operators + +A number of [[extended filter operators|The Extended Listops Filters]] are necessary for the manipulation of lists. These operators have been designed primarily for use in subfilter expressions whereby the modified current list is returned in place of the current list. + + +<<.group-heading "Listops Operators">> + + + + + +<<.operator-rows "[tag[Filter Operators]tag[Listops Operators]tag[Order Operators]!tag[String Operators]!tag[Tag Operators]!tag[Special Operators]sort[]]">> +
OperatorPurpose
+ +! Examples + +In this example we shall populate and then clear a list in an ordinary field (myfield) of this tiddler (the default.) + +<$macrocall $name='wikitext-example-without-html' +src="""<$button> +<$action-listops $list="myfield" $subfilter="efg hlm pqr"/> +Populate 'myfield' + +<$button> +<$action-listops $list="myfield" $subfilter="abc xyz"/> +Append More Items + +<$button> +<$action-listops $list="myfield" $subfilter="-abc -hlm"/> +Remove Items + +<$button> +<$action-listops $list="myfield" $filter="[[]]"/> +Clear 'myfield' + + +<$list filter="[list[!!myfield]]"> + +"""/> + +--- +In this example we shall append and remove items from a list in an ordinary field (myfield) of this tiddler (the default) and sort the resultant list. We shall then remove some of the appended items and sort the resulting list in reverse order. + +<$macrocall $name='wikitext-example-without-html' +src="""<$button> +<$action-listops $list="myfield" $subfilter="-efg ijk xyz [[this is a title]] +[sort[]]"/> +Mangle List + +<$button> +<$action-listops $list="myfield" $subfilter="-xyz -[[this is a title]] +[!sort[]]"/> +Unmangle List + + +<$list filter="[list[!!myfield]]"> + +"""/> + +--- +In this example we shall append a few tags to the 'tags' field of this tiddler (the default.) We shall then remove some of the appended tags. + +<$macrocall $name='wikitext-example-without-html' +src="""<$button> +<$action-listops $tags="+[append{Days of the Week!!short}] $:/tag1 $:/tag2 $:/tag3"/> +Populate 'tags' + +<$button> +<$action-listops $tags="+[!remove:2{!!tags}]"/> +Remove Last Two Tags + +<$button> +<$action-listops $tags="+[!prefix[$:/]]"/> +Remove System Tags + +<$button> +<$action-listops $tags="-Mon -Tue"/> +Remove Mon and Tue + +<$button> +<$action-listops $tags="+[prefix[$:/]] ActionWidgets Widgets"/> +Remove User Tags + +<$button> +<$action-listops $tags="+[[]] ActionWidgets Widgets"/> +Clear Tags + + +<$list filter="[list[!!tags]]"> + +"""/> From 7370d616029d1bef0e0c56f9640b7dc2325e94d0 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 09:59:41 +0200 Subject: [PATCH 07/33] Create The Extended Listops Filters.tid Supplementary documentation for the ActionListops widget -- examples using the extended filters --- .../widgets/The Extended Listops Filters.tid | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 editions/tw5.com/tiddlers/widgets/The Extended Listops Filters.tid diff --git a/editions/tw5.com/tiddlers/widgets/The Extended Listops Filters.tid b/editions/tw5.com/tiddlers/widgets/The Extended Listops Filters.tid new file mode 100644 index 000000000..7c4a57152 --- /dev/null +++ b/editions/tw5.com/tiddlers/widgets/The Extended Listops Filters.tid @@ -0,0 +1,113 @@ +created: 20151014170727812 +creator: matabele +days: Fri Wed Mon Tue +dofwks: Mon Tue Wed Thu Fri Sat Sun +item1: six +item2: seven +item3: eight +list: Yesterday Today Tomorrow +marker: Thursday +modified: 20151108054957921 +modifier: matabele +myfield: Monday Tuesday [[Middle of the Week]] Thursday Friday Saturday Sunday +numbers: 1 2 3 4 five 6 7 8 9 +title: The Extended Listops Filters + +! Introduction + +A number of extended filters are necessary to manipulate lists. The first set of filters are designed to move items from the tail of the list and insert them at specified locations in the list. Items are often appended to the list before using these filters. In general, these filters accept a suffix specifying the number of items to move (defaults to 1.) + +A second set of filters are designed to either add or remove from the list, a selected range of items from an array. These filters are best used with a reference to an array, stored in a field or data indexe elsewhere in the wiki (they may be used with a simple list of items, provided the items do not include white space.) In general, these filters accept a suffix specifying the number of items to move (defaults to All.) + +! Examples + +In this example we shall populate the '~DataIndex' index of the tiddler '~MyData' with the names of the days of the week, then clear this list. + +<$macrocall $name='wikitext-example-without-html' +src="""<$button> +<$action-listops $tiddler="ListopsData" $index="DataIndex" $filter="[list[Days of the Week]]"/> +Get days-of-the-week + +<$button> +<$action-listops $tiddler="ListopsData" $index="DataIndex" $filter="[[]]"/> +Clear + + +{{ListopsData}}"""/> + +--- +In this example we shall slice the populated list from the 'DaysOfTheWeek' index of the tiddler '~MyData' in order to insert items before and after a marker item (Wednesday) that are first appended to the list. + +<$macrocall $name='wikitext-example-without-html' +src="""<$button> +<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="one two +[putbefore:2[Wednesday]]"/> +Put 2 Items Before Wednesday + +<$button> +<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="four five +[putafter:2[Wednesday]] three +[putbefore[Wednesday]]"/> +Put One Item Before & Two Items After Wednesday + + +{{ListopsData}}"""/> + +--- +In this example we shall slice the populated list from the 'DaysOfTheWeek' index of the tiddler '~MyData' in order to replace the marker item (Wednesday) with items which are first appended to the list. We shall then move 3 items to the head of the list which have first been appended to the list from referenced fields. + +<$macrocall $name='wikitext-example-without-html' +src="""<$button> +<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="[[---o]] [[o---]] +[replace:2{!!marker}]"/> +Replace '!!marker' with 2 Items + +<$button> +<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="[{!!item1}] [{!!item2}] [{!!item3}] +[putfirst:3[]]"/> +Put 3 Items First + + +{{ListopsData}}"""/> + +--- +In this example we shall slice the populated list from the 'DaysOfTheWeek' index of the tiddler '~MyData' in order to append to the truncated list, items from a referenced field. We shall then remove the first two of the items added. + +<$macrocall $name='wikitext-example-without-html' +src="""|list: |<$view field="list"/> | + +<$button> +<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[allbefore:include[Wednesday]] +[prepend{!!list}]"/> +Prepend '!!list' to items before 'Wednesday' + +<$button> +<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[remove:2{!!list}]"/> +Remove first two items in '!!list' from current list + +<$button> +<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[!remove:1{!!list}]"/> +Remove last item in '!!list' from current list + + +{{ListopsData}}"""/> + +--- +In this example we shall populate the list with numbers, then move items one by one from the head to the tail and from the tail to the head (best seen by clicking the lower buttons several times.) + +This example illustrates that the append[] and prepend[] operators do not enforce unique instances of an item and that, with the next run, any duplicates are removed. + +<$macrocall $name='wikitext-example-without-html' +src="""<$button> +<$action-listops $tiddler="ListopsData" $index="DataIndex" $filter="[[]]" $subfilter="+[append:3{!!numbers}]"/> +Setup some numbers + +<$button> +<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[!append:6{!!numbers}]"/> +Append more numbers + + +<$button> +<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[putfirst:2[]]"/> +Move last 2 items to the head + +<$button> +<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[putlast[]]"/> +Move the head to the last item + + +{{ListopsData}}"""/> From fad106d2d5d7b94190a171deea31f9d7a851dc02 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:02:28 +0200 Subject: [PATCH 08/33] Update FilterOperators.tid Added category for extended listops filter operators --- editions/tw5.com/tiddlers/filters/FilterOperators.tid | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/editions/tw5.com/tiddlers/filters/FilterOperators.tid b/editions/tw5.com/tiddlers/filters/FilterOperators.tid index 60fdb35cd..5390dbf55 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperators.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperators.tid @@ -1,9 +1,3 @@ -created: 20140410103123179 -modified: 20150917193612610 -tags: Filters -title: Filter Operators -type: text/vnd.tiddlywiki - \define .operator-rows(filter) <$list filter="$filter$"> <$link to={{!!title}}>{{!!caption}} @@ -28,7 +22,9 @@ The following table lists all the core operators. The commonest ones are checkma <<.operator-rows "[tag[Filter Operators]!tag[Order Operators]!tag[String Operators]!tag[Tag Operators]!tag[Special Operators]sort[]]">> <<.group-heading "Order Operators">> -<<.operator-rows "[tag[Filter Operators]tag[Order Operators]!tag[String Operators]!tag[Tag Operators]!tag[Special Operators]sort[]]">> +<<.operator-rows "[tag[Filter Operators]tag[Order Operators]!tag[Listops Operators]!tag[String Operators]!tag[Tag Operators]!tag[Special Operators]sort[]]">> +<<.group-heading "Listops Operators">> +<<.operator-rows "[tag[Filter Operators]tag[Listops Operators]tag[Order Operators]!tag[String Operators]!tag[Tag Operators]!tag[Special Operators]sort[]]">> <<.group-heading "String Operators">> <<.operator-rows "[tag[Filter Operators]!tag[Order Operators]tag[String Operators]!tag[Tag Operators]!tag[Special Operators]sort[]]">> <<.group-heading "Tag Operators">> From 2adb005c28107101e9f54fecc5b46d1de0018158 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:05:26 +0200 Subject: [PATCH 09/33] Create allafter.tid --- editions/tw5.com/tiddlers/filters/allafter.tid | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/allafter.tid diff --git a/editions/tw5.com/tiddlers/filters/allafter.tid b/editions/tw5.com/tiddlers/filters/allafter.tid new file mode 100644 index 000000000..bdb21a919 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/allafter.tid @@ -0,0 +1,17 @@ +caption: allafter +created: 20151017145021839 +creator: matabele +modified: 20151108051523860 +modifier: matabele +op-input: a list of items +op-output: all items after the marker +op-parameter: the list item to be used as a marker +op-parameter-name: marker +op-purpose: discard all items except those after the marker +op-suffix: specifying a suffix ('include') will include the marker in the output +revision: 0 +tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]] +title: allafter Operator +type: text/vnd.tiddlywiki + +<<.operator-examples "allafter">> From d87c328fd95831d956df2ed793703fa1af01e42b Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:06:50 +0200 Subject: [PATCH 10/33] Create allafter.tid --- .../tw5.com/tiddlers/filters/examples/allafter.tid | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/examples/allafter.tid diff --git a/editions/tw5.com/tiddlers/filters/examples/allafter.tid b/editions/tw5.com/tiddlers/filters/examples/allafter.tid new file mode 100644 index 000000000..62f29dbc2 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/allafter.tid @@ -0,0 +1,13 @@ +created: 20151022123929297 +creator: matabele +modified: 20151108080543606 +modifier: matabele +revision: 0 +tags: [[Operator Examples]] [[allafter Operator]] +title: allafter Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]] +[allafter[Wednesday]]">> +<<.operator-example 2 "[list[Days of the Week]] +[allafter:include[Wednesday]]">> From e9c79faf0509df1fab812aa7e33b540d305ee7df Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:08:01 +0200 Subject: [PATCH 11/33] Create allbefore.tid --- editions/tw5.com/tiddlers/filters/allbefore.tid | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/allbefore.tid diff --git a/editions/tw5.com/tiddlers/filters/allbefore.tid b/editions/tw5.com/tiddlers/filters/allbefore.tid new file mode 100644 index 000000000..51c176747 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/allbefore.tid @@ -0,0 +1,17 @@ +caption: allbefore +created: 20151017145131857 +creator: matabele +modified: 20151108051507578 +modifier: matabele +op-input: a list of items +op-output: all items before the marker +op-parameter: the list item to be used as a marker +op-parameter-name: marker +op-purpose: discard all items except those before the marker +op-suffix: specifying a suffix ('include') will include the marker in the output +revision: 0 +tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]] +title: allbefore Operator +type: text/vnd.tiddlywiki + +<<.operator-examples "allbefore">> From 31b9835a4e8b9536a356253e8e829f894d36cc7f Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:09:00 +0200 Subject: [PATCH 12/33] Create allbefore.tid --- .../tw5.com/tiddlers/filters/examples/allbefore.tid | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/examples/allbefore.tid diff --git a/editions/tw5.com/tiddlers/filters/examples/allbefore.tid b/editions/tw5.com/tiddlers/filters/examples/allbefore.tid new file mode 100644 index 000000000..4a125df86 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/allbefore.tid @@ -0,0 +1,13 @@ +created: 20151017150902487 +creator: matabele +modified: 20151108051438263 +modifier: matabele +revision: 0 +tags: [[Operator Examples]] [[allbefore Operator]] +title: allbefore Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]allbefore[Wednesday]]">> +<<.operator-example 2 "[list[Days of the Week]allbefore:include[Wednesday]]">> From b2edbd8d1d0b648c49b0e23329a0b33a160ce1ce Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:10:37 +0200 Subject: [PATCH 13/33] Create append.tid --- editions/tw5.com/tiddlers/filters/append.tid | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/append.tid diff --git a/editions/tw5.com/tiddlers/filters/append.tid b/editions/tw5.com/tiddlers/filters/append.tid new file mode 100644 index 000000000..c481a790e --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/append.tid @@ -0,0 +1,18 @@ +caption: append +created: 20151017145358368 +creator: matabele +modified: 20151108051540981 +modifier: matabele +op-input: a list of items +op-neg-output: a list with items appended from the tail of the operand array +op-output: a list with items appended from the head of the operand array +op-parameter: the array of items to be appended to the tail of the list +op-parameter-name: list +op-purpose: append a range of items from an array to the list +op-suffix: an integer N, defaulting to all +revision: 0 +tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]] +title: append Operator +type: text/vnd.tiddlywiki + +<<.operator-examples "append">> From abdd1e7fd6610d2064a940ee768f456cd652c774 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:11:17 +0200 Subject: [PATCH 14/33] Create append.tid --- .../tiddlers/filters/examples/append.tid | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/examples/append.tid diff --git a/editions/tw5.com/tiddlers/filters/examples/append.tid b/editions/tw5.com/tiddlers/filters/examples/append.tid new file mode 100644 index 000000000..3eddb92de --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/append.tid @@ -0,0 +1,17 @@ +created: 20151017150942725 +creator: matabele +modified: 20151108051557748 +modifier: matabele +revision: 0 +tags: [[Operator Examples]] [[append Operator]] +title: append Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]append[Tomorrow]]">> +<<.operator-example 2 "[list[Days of the Week]append[Yesterday Today Tomorrow]]">> + +;Append the first 4 short days of the week to our list + +<<.operator-example 3 "[list[Days of the Week]append:4{Days of the Week!!short}]">> From b1cfc8633f67cf0370c9022e616a4d710eb856a8 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:25:04 +0200 Subject: [PATCH 15/33] Create move.tid --- editions/tw5.com/tiddlers/filters/move.tid | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/move.tid diff --git a/editions/tw5.com/tiddlers/filters/move.tid b/editions/tw5.com/tiddlers/filters/move.tid new file mode 100644 index 000000000..6007c6da3 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/move.tid @@ -0,0 +1,17 @@ +caption: move +created: 20151022123413501 +creator: matabele +modified: 20151108082424017 +modifier: matabele +op-input: a list of items +op-output: re-ordered list of items +op-parameter: the list item to be used as a marker +op-parameter-name: marker +op-purpose: move marker N places in the list +op-suffix: an integer N, defaulting to 1 +revision: 0 +tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]] +title: move Operator +type: text/vnd.tiddlywiki + +<<.operator-examples "move">> From 18a0f6b12df24bf9f8e7be516abfebe029c27fd1 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:25:42 +0200 Subject: [PATCH 16/33] Create move.tid --- editions/tw5.com/tiddlers/filters/examples/move.tid | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/examples/move.tid diff --git a/editions/tw5.com/tiddlers/filters/examples/move.tid b/editions/tw5.com/tiddlers/filters/examples/move.tid new file mode 100644 index 000000000..a7c90e9ef --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/move.tid @@ -0,0 +1,13 @@ +created: 20151022123633433 +creator: matabele +modified: 20151108051643871 +modifier: matabele +revision: 0 +tags: [[Operator Examples]] [[move Operator]] +title: move Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]] +[move[Wednesday]]">> +<<.operator-example 2 "[list[Days of the Week]] +[move:-2[Wednesday]]">> From 1358cd5185ceb156ea3ef2ec939fd211496ca7e3 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:26:45 +0200 Subject: [PATCH 17/33] Create prepend.tid --- editions/tw5.com/tiddlers/filters/prepend.tid | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/prepend.tid diff --git a/editions/tw5.com/tiddlers/filters/prepend.tid b/editions/tw5.com/tiddlers/filters/prepend.tid new file mode 100644 index 000000000..e45c1b0b1 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/prepend.tid @@ -0,0 +1,18 @@ +caption: prepend +created: 20151017145439292 +creator: matabele +modified: 20151108051701587 +modifier: matabele +op-input: a list of items +op-neg-output: a list with items prepended from the tail of the operand array +op-output: a list with items prepended from the head of the operand array +op-parameter: the array of items to be prepended to the head of the list +op-parameter-name: list +op-purpose: prepend a range of items from an array to the list +op-suffix: an integer N, defaulting to all +revision: 0 +tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]] +title: prepend Operator +type: text/vnd.tiddlywiki + +<<.operator-examples "prepend">> From 88a5c742e7af015e0bd57052cde80768c0580233 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:27:35 +0200 Subject: [PATCH 18/33] Create prepend.tid --- .../tiddlers/filters/examples/prepend.tid | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/examples/prepend.tid diff --git a/editions/tw5.com/tiddlers/filters/examples/prepend.tid b/editions/tw5.com/tiddlers/filters/examples/prepend.tid new file mode 100644 index 000000000..d2dceced5 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/prepend.tid @@ -0,0 +1,18 @@ +created: 20151017151508135 +creator: matabele +modified: 20151108051743531 +modifier: matabele +revision: 0 +tags: [[Operator Examples]] [[prepend Operator]] +title: prepend Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +The operator may be used to prepend a number of items to the list. + +<<.operator-example 1 "[list[Days of the Week]prepend[Yesterday Today Tomorrow]]">> + +The operand may list only items without spaces -- to include items with spaces, use a reference to an array e.g. prepend the last three short days of the week to the list + +<<.operator-example 2 "[list[Days of the Week]!prepend:3{Days of the Week!!short}]">> From ec2d819c8c07ce167d82c1bb416d6723de000627 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:28:38 +0200 Subject: [PATCH 19/33] Create putafter.tid --- editions/tw5.com/tiddlers/filters/putafter.tid | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/putafter.tid diff --git a/editions/tw5.com/tiddlers/filters/putafter.tid b/editions/tw5.com/tiddlers/filters/putafter.tid new file mode 100644 index 000000000..dd41a4c61 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/putafter.tid @@ -0,0 +1,17 @@ +caption: putafter +created: 20151017144307862 +creator: matabele +modified: 20151108051805137 +modifier: matabele +op-input: a list of items +op-output: re-ordered list of items +op-parameter: the list item to be used as a marker +op-parameter-name: marker +op-purpose: move N trailing items after the marker +op-suffix: an integer N, defaulting to 1 +revision: 0 +tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]] +title: putafter Operator +type: text/vnd.tiddlywiki + +<<.operator-examples "putafter">> From 72889a0527e7174ee14ef61fa67345f67e19c936 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:29:17 +0200 Subject: [PATCH 20/33] Create putafter.tid --- .../tw5.com/tiddlers/filters/examples/putafter.tid | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/examples/putafter.tid diff --git a/editions/tw5.com/tiddlers/filters/examples/putafter.tid b/editions/tw5.com/tiddlers/filters/examples/putafter.tid new file mode 100644 index 000000000..0241e0a32 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/putafter.tid @@ -0,0 +1,14 @@ +created: 20151017151905558 +creator: matabele +modified: 20151108051825288 +modifier: matabele +revision: 0 +tags: [[Operator Examples]] [[putafter Operator]] +title: putafter Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]] +[putafter[Wednesday]]">> +<<.operator-example 2 "[list[Days of the Week]] +[putafter:2[Tuesday]]">> +<<.operator-example 3 "[list[Days of the Week]] [[Yesterday]] [[Today]] [[Tomorrow]] +[putafter:3[Tuesday]]">> From cab0900ddd59c6ec78d2b5d234dd0e73c5b9ddd0 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:30:08 +0200 Subject: [PATCH 21/33] Create putbefore.tid --- editions/tw5.com/tiddlers/filters/putbefore.tid | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/putbefore.tid diff --git a/editions/tw5.com/tiddlers/filters/putbefore.tid b/editions/tw5.com/tiddlers/filters/putbefore.tid new file mode 100644 index 000000000..bf14b29eb --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/putbefore.tid @@ -0,0 +1,17 @@ +caption: putbefore +created: 20140410103123179 +creator: matabele +modified: 20151108051842788 +modifier: matabele +op-input: a [[selection of titles|Title Selection]] +op-output: the first <<.place N>> input titles +op-parameter: an integer, defaulting to 1 +op-parameter-name: marker +op-purpose: move N trailing items before the marker +op-suffix: an integer N, defaulting to 1 +revision: 0 +tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]] +title: putbefore Operator +type: text/vnd.tiddlywiki + +<<.operator-examples "putbefore">> From cb6b8233fadd45b856b8105759676d98fdc57fa6 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:30:47 +0200 Subject: [PATCH 22/33] Create putbefore.tid --- .../tiddlers/filters/examples/putbefore.tid | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/examples/putbefore.tid diff --git a/editions/tw5.com/tiddlers/filters/examples/putbefore.tid b/editions/tw5.com/tiddlers/filters/examples/putbefore.tid new file mode 100644 index 000000000..467cc09e6 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/putbefore.tid @@ -0,0 +1,14 @@ +created: 20151022142602628 +creator: matabele +modified: 20151108051906935 +modifier: matabele +revision: 0 +tags: [[Operator Examples]] [[putbefore Operator]] +title: putbefore Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]] +[putbefore[Wednesday]]">> +<<.operator-example 2 "[list[Days of the Week]] +[putbefore:2[Tuesday]]">> +<<.operator-example 3 "[list[Days of the Week]] [[Yesterday]] [[Today]] [[Tomorrow]] +[putbefore:3[Tuesday]]">> From 008f22b511ac135918cad973c48b8f7deb74fb2b Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:32:12 +0200 Subject: [PATCH 23/33] Create putfirst.tid --- editions/tw5.com/tiddlers/filters/putfirst.tid | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/putfirst.tid diff --git a/editions/tw5.com/tiddlers/filters/putfirst.tid b/editions/tw5.com/tiddlers/filters/putfirst.tid new file mode 100644 index 000000000..ed07a6ce2 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/putfirst.tid @@ -0,0 +1,16 @@ +caption: putfirst +created: 20151017144802884 +creator: matabele +modified: 20151108051922934 +modifier: matabele +op-input: a list of items +op-output: re-ordered list of items +op-parameter: ignored +op-purpose: move N trailing items to the head of the list +op-suffix: an integer N, defaulting to 1 +revision: 0 +tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]] +title: putfirst Operator +type: text/vnd.tiddlywiki + +<<.operator-examples "putfirst">> From 617c13d1967f575bda34071d06d08cd189ab30a8 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:32:56 +0200 Subject: [PATCH 24/33] Create putfirst.tid --- .../tw5.com/tiddlers/filters/examples/putfirst.tid | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/examples/putfirst.tid diff --git a/editions/tw5.com/tiddlers/filters/examples/putfirst.tid b/editions/tw5.com/tiddlers/filters/examples/putfirst.tid new file mode 100644 index 000000000..7cbc0aece --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/putfirst.tid @@ -0,0 +1,14 @@ +created: 20151017152847899 +creator: matabele +modified: 20151108051943204 +modifier: matabele +revision: 0 +tags: [[Operator Examples]] [[putfirst Operator]] +title: putfirst Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]] +[putfirst[]]">> +<<.operator-example 2 "[list[Days of the Week]] +[putfirst:2[]]">> +<<.operator-example 3 "[list[Days of the Week]] [[Yesterday]] [[Today]] [[Tomorrow]] +[putfirst:-2[]]">> From 0c78c63fae484c1a99b78e1cfa0b1765827040a4 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:33:39 +0200 Subject: [PATCH 25/33] Create putlast.tid --- editions/tw5.com/tiddlers/filters/putlast.tid | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/putlast.tid diff --git a/editions/tw5.com/tiddlers/filters/putlast.tid b/editions/tw5.com/tiddlers/filters/putlast.tid new file mode 100644 index 000000000..828315ec8 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/putlast.tid @@ -0,0 +1,16 @@ +caption: putlast +created: 20151017144822139 +creator: matabele +modified: 20151108052000425 +modifier: matabele +op-input: a list of items +op-output: re-ordered list of items +op-parameter: ignored +op-purpose: move N leading items to the tail of the list +op-suffix: an integer N, defaulting to 1 +revision: 0 +tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]] +title: putlast Operator +type: text/vnd.tiddlywiki + +<<.operator-examples "putlast">> From 91c87ec2ac38f0c24170a8706a699dd3ae6dfb5d Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:34:21 +0200 Subject: [PATCH 26/33] Create putlast.tid --- .../tw5.com/tiddlers/filters/examples/putlast.tid | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/examples/putlast.tid diff --git a/editions/tw5.com/tiddlers/filters/examples/putlast.tid b/editions/tw5.com/tiddlers/filters/examples/putlast.tid new file mode 100644 index 000000000..c31e28ced --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/putlast.tid @@ -0,0 +1,14 @@ +created: 20151017153037776 +creator: matabele +modified: 20151108052020761 +modifier: matabele +revision: 0 +tags: [[Operator Examples]] [[putlast Operator]] +title: putlast Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]] +[putlast[]]">> +<<.operator-example 2 "[list[Days of the Week]] +[putlast:2[]]">> +<<.operator-example 3 "one two three [list[Days of the Week]] +[putlast:-3[]]">> From 12431a9fbc357650c484e58a1fbc48e717dd79dc Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:35:05 +0200 Subject: [PATCH 27/33] Create remove.tid --- editions/tw5.com/tiddlers/filters/remove.tid | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/remove.tid diff --git a/editions/tw5.com/tiddlers/filters/remove.tid b/editions/tw5.com/tiddlers/filters/remove.tid new file mode 100644 index 000000000..bc656fae2 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/remove.tid @@ -0,0 +1,19 @@ +caption: remove +created: 20151017144531676 +creator: matabele +modified: 20151108052035773 +modifier: matabele +op-input: a list of items +op-neg-output: items removed from current list that appear at the tail of the operand array +op-output: items removed from current list that appear at the head of the operand array +op-parameter: an array of items to remove +op-parameter-name: array +op-prefix: causes N items from the end of the array to be removed +op-purpose: remove a range of items in an array from the current list +op-suffix: an integer N, defaulting to all +revision: 0 +tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]] +title: remove Operator +type: text/vnd.tiddlywiki + +<<.operator-examples "remove">> From 34e0bf13f2ee41a3ebab8fb5e2c2ed6f36fd1289 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:35:37 +0200 Subject: [PATCH 28/33] Create remove.tid --- .../tw5.com/tiddlers/filters/examples/remove.tid | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/examples/remove.tid diff --git a/editions/tw5.com/tiddlers/filters/examples/remove.tid b/editions/tw5.com/tiddlers/filters/examples/remove.tid new file mode 100644 index 000000000..aa5755d10 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/remove.tid @@ -0,0 +1,14 @@ +created: 20151018054129966 +creator: matabele +modified: 20151108052052606 +modifier: matabele +revision: 0 +tags: [[Operator Examples]] [[remove Operator]] +title: remove Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]] +[remove[Tuesday Wednesday Thursday]]">> +<<.operator-example 2 "[list[Days of the Week]] +[remove:3[Monday Wednesday Friday Saturday]]">> +<<.operator-example 3 "[list[Days of the Week]] +[!remove:2{Days of the Week!!list}]">> From 85895374ea0a4d524116761a4fed42b8f68ba34e Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:36:17 +0200 Subject: [PATCH 29/33] Create replace.tid --- editions/tw5.com/tiddlers/filters/replace.tid | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/replace.tid diff --git a/editions/tw5.com/tiddlers/filters/replace.tid b/editions/tw5.com/tiddlers/filters/replace.tid new file mode 100644 index 000000000..48cc4d45c --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/replace.tid @@ -0,0 +1,17 @@ +caption: replace +created: 20151017144531676 +creator: matabele +modified: 20151108052110493 +modifier: matabele +op-input: a list of items +op-output: re-ordered list of items +op-parameter: the item to be used as a marker +op-parameter-name: marker +op-purpose: replace marker with N trailing items +op-suffix: an integer N, defaulting to 1 +revision: 0 +tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]] +title: replace Operator +type: text/vnd.tiddlywiki + +<<.operator-examples "replace">> From 7ba264919400db0613b4ef97c3c965a3a62cc03b Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:36:53 +0200 Subject: [PATCH 30/33] Create replace.tid --- .../tw5.com/tiddlers/filters/examples/replace.tid | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/examples/replace.tid diff --git a/editions/tw5.com/tiddlers/filters/examples/replace.tid b/editions/tw5.com/tiddlers/filters/examples/replace.tid new file mode 100644 index 000000000..0e660be3b --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/replace.tid @@ -0,0 +1,14 @@ +created: 20151017153634099 +creator: matabele +modified: 20151108052127454 +modifier: matabele +revision: 0 +tags: [[Operator Examples]] [[replace Operator]] +title: replace Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "[list[Days of the Week]] Last +[replace[Wednesday]]">> +<<.operator-example 2 "[list[Days of the Week]] Last +[replace:2[Tuesday]]">> +<<.operator-example 3 "[list[Days of the Week]] [[Yesterday]] [[Today]] [[Tomorrow]] +[replace:3[Tuesday]]">> From 085ebd4e23fcdd50d6310dae6bd1c1c32166ad6c Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:37:39 +0200 Subject: [PATCH 31/33] Create sortby.tid --- editions/tw5.com/tiddlers/filters/sortby.tid | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/sortby.tid diff --git a/editions/tw5.com/tiddlers/filters/sortby.tid b/editions/tw5.com/tiddlers/filters/sortby.tid new file mode 100644 index 000000000..087bd6cef --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/sortby.tid @@ -0,0 +1,16 @@ +caption: sortby +created: 20151017145021839 +creator: matabele +modified: 20151108052142057 +modifier: matabele +op-input: a list of items +op-output: all items sorted by lookup list +op-parameter: a list specifying the order in which to sort the current list +op-parameter-name: order +op-purpose: sort the current list in the order of the list referenced in the operand +revision: 0 +tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]] +title: sortby Operator +type: text/vnd.tiddlywiki + +<<.operator-examples "sortby">> From 8980e491c409eb3c9661bde4b171bf840319c6d1 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:38:14 +0200 Subject: [PATCH 32/33] Create sortby.tid --- .../tw5.com/tiddlers/filters/examples/sortby.tid | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/examples/sortby.tid diff --git a/editions/tw5.com/tiddlers/filters/examples/sortby.tid b/editions/tw5.com/tiddlers/filters/examples/sortby.tid new file mode 100644 index 000000000..d69147ef7 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/sortby.tid @@ -0,0 +1,14 @@ +created: 20151018123433917 +creator: matabele +modified: 20151108052158811 +modifier: matabele +revision: 0 +tags: [[Operator Examples]] [[sortby Operator]] +title: sortby Operator (Examples) +type: text/vnd.tiddlywiki + +<<.using-days-of-week>> + +<<.operator-example 1 "10 6 4 9 3 2 8 +[sortby[1 2 3 4 5 6 7 8 9 10]]">> +<<.operator-example 2 "Friday Tuesday Monday Thursday Sunday +[sortby{Days of the Week!!list}]">> +<<.operator-example 3 "1 Mon 5 Fri 4 Tue Sun 2 +[sortby{Days of the Week!!short}]">> From 5877a268556fba2086b0b746801908d6570d2899 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Sun, 8 Nov 2015 10:40:49 +0200 Subject: [PATCH 33/33] Create ListopsData.tid Data tiddler for Extended Listops documentation examples --- editions/tw5.com/tiddlers/widgets/ListopsData.tid | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 editions/tw5.com/tiddlers/widgets/ListopsData.tid diff --git a/editions/tw5.com/tiddlers/widgets/ListopsData.tid b/editions/tw5.com/tiddlers/widgets/ListopsData.tid new file mode 100644 index 000000000..2c64aebad --- /dev/null +++ b/editions/tw5.com/tiddlers/widgets/ListopsData.tid @@ -0,0 +1,9 @@ +created: 20151017094630847 +creator: matabele +daysoftheweek: four three Fri Thu Wed Tue Mon +modified: 20151108041839747 +modifier: matabele +title: ListopsData +type: application/x-tiddler-dictionary + +DataIndex: