diff --git a/core/modules/filters/getIndex.js b/core/modules/filters/get_index.js similarity index 93% rename from core/modules/filters/getIndex.js rename to core/modules/filters/get_index.js index 1d3dd0224..737175743 100644 --- a/core/modules/filters/getIndex.js +++ b/core/modules/filters/get_index.js @@ -1,5 +1,5 @@ /*\ -title: $:/core/modules/filters/getIndex.js +title: $:/core/modules/filters/getindex.js type: application/javascript module-type: filteroperator diff --git a/editions/tw5.com/tiddlers/filters/examples/getindex.tid b/editions/tw5.com/tiddlers/filters/examples/getindex.tid new file mode 100644 index 000000000..b0512507b --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/getindex.tid @@ -0,0 +1,7 @@ +created: 20150203140000000 +modified: 20150203140000000 +tags: [[getindex Operator]] [[Operator Examples]] +title: getindex Operator (Examples) + +<<.operator-example 1 "[[$:/palettes/Vanilla]getindex[background]]" "returns the value at index ''background'' of the [[DataTiddler|DataTiddlers]] [[$:/palettes/Vanilla]]">> +<<.operator-example 2 "[tag[$:/tags/Palette]getindex[background]]" "returns all background colors defined in any of the ColourPalettes">> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/filters/getindex.tid b/editions/tw5.com/tiddlers/filters/getindex.tid new file mode 100644 index 000000000..1401af280 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/getindex.tid @@ -0,0 +1,17 @@ +created: 20150203140000000 +modified: 20150203140000000 +tags: [[Filter Operators]] [[Field Operators]] +title: getindex Operator +caption: getindex +purpose: returns the value at an index of DataTiddlers + +<$macrocall $name=".operator-def" +input="a [[selection of titles|Title Selection]]" +parameter="the name of an [[index|DataTiddlers]]" +paramName="i" +output="the values at index <<.place f>> in each of the input titles" +/> + +Each input title is tested in turn. If the corresponding tiddler is a [[DataTiddler|DataTiddlers]] and has the index <<.place i>> defined, its value is appended to the output. + +<<.operator-examples "getindex">> \ No newline at end of file