From f067fa79d32bae1a6deff712ce44810722494902 Mon Sep 17 00:00:00 2001 From: pmario Date: Thu, 23 May 2024 07:24:13 +0200 Subject: [PATCH] rename jsonvariable to jsonvariables --- .../filters/{jsonvariable.js => jsonvariables.js} | 4 ++-- core/wiki/macros/search-variables.tid | 4 ++-- .../tiddlers/jsonvariable Operator (Examples).tid | 14 +++++++------- .../tw5.com/tiddlers/jsonvariable Operator.tid | 14 +++++++------- .../tw5.com/tiddlers/test-jsonvariable-conat.tid | 10 +++++----- 5 files changed, 23 insertions(+), 23 deletions(-) rename core/modules/filters/{jsonvariable.js => jsonvariables.js} (88%) diff --git a/core/modules/filters/jsonvariable.js b/core/modules/filters/jsonvariables.js similarity index 88% rename from core/modules/filters/jsonvariable.js rename to core/modules/filters/jsonvariables.js index cb5e1a575..6bacfe562 100644 --- a/core/modules/filters/jsonvariable.js +++ b/core/modules/filters/jsonvariables.js @@ -1,5 +1,5 @@ /*\ -title: $:/core/modules/filters/jsonvariable.js +title: $:/core/modules/filters/jsonvariables.js type: application/javascript module-type: filteroperator @@ -16,7 +16,7 @@ Display as JSON with basic formatting /* Export our filter function */ -exports.jsonvariable = function(source,operator,options) { +exports.jsonvariables = function(source,operator,options) { var results = [], widget = options.widget; // "replacer" must be defined, otherwise JSON.stringify will throw a circular reference error RSOD diff --git a/core/wiki/macros/search-variables.tid b/core/wiki/macros/search-variables.tid index c1c10943c..897bc77aa 100644 --- a/core/wiki/macros/search-variables.tid +++ b/core/wiki/macros/search-variables.tid @@ -56,7 +56,7 @@ tags: $:/tags/Global
  • <$text text=<>/>
    <% if [prefix[\function]] %> -
    <$text text={{{ [jsonvariable[]jsonextract[srcVariable],[value]] }}}/>
    +
    <$text text={{{ [jsonvariables[]jsonextract[srcVariable],[value]] }}}/>
    <% endif %>
    <$text text={{{ [getvariable[]] }}}/>
  • @@ -235,7 +235,7 @@ tags: $:/tags/Global <> <% endif %> <% if [prefix[\function]] %> - <$codeblock code={{{ [jsonvariable[]jsonextract[srcVariable],[value]] }}}/> + <$codeblock code={{{ [jsonvariables[]jsonextract[srcVariable],[value]] }}}/> <% endif %>
    <$text text={{{ [getvariable[]] }}}/>
    diff --git a/editions/tw5.com/tiddlers/jsonvariable Operator (Examples).tid b/editions/tw5.com/tiddlers/jsonvariable Operator (Examples).tid index 983c2b4e9..b8558563a 100644 --- a/editions/tw5.com/tiddlers/jsonvariable Operator (Examples).tid +++ b/editions/tw5.com/tiddlers/jsonvariable Operator (Examples).tid @@ -1,15 +1,15 @@ created: 20240506132850677 modified: 20240506151551620 -tags: [[Operator Examples]] [[jsonvariable Operator]] -title: jsonvariable Operator (Examples) +tags: [[Operator Examples]] [[jsonvariables Operator]] +title: jsonvariables Operator (Examples) type: text/vnd.tiddlywiki -The following example shows the "internal" structure of the `fn.test` function defined in <<.olink jsonvariable>> operator +The following example shows the "internal" structure of the `fn.test` function defined in <<.olink jsonvariables>> operator <<.example 1 """\procedure testProc() [[aa aa]] bb \function fn.test(splitChar:" " not-used) [enlistformat:titlelist[]] -
    <$text text={{{[[fn.test]jsonvariable[]]}}}/>
    +
    <$text text={{{[[fn.test]jsonvariables[]]}}}/>
    """>> The following example shows the same structure ''pretty printed'' using the <<.olink format>> filter operator @@ -19,7 +19,7 @@ The following example shows the same structure ''pretty printed'' using the <<.o \function tab() [charcode[9]] -
    <$text text={{{[[fn.test]jsonvariable[]format:json]}}}/>
    +
    <$text text={{{[[fn.test]jsonvariables[]format:json]}}}/>
    """>> The following example extracts the ''function definition'' using the <<.olink jsonextract>> filter operator @@ -27,7 +27,7 @@ The following example extracts the ''function definition'' using the <<.olink js <<.example 3 """\procedure testProc() [[aa aa]] bb \function fn.test(splitChar:" " not-used) [enlistformat:titlelist[]] -
    <$text text={{{[[fn.test]jsonvariable[]jsonextract[srcVariable],[value]]}}}/>
    +
    <$text text={{{[[fn.test]jsonvariables[]jsonextract[srcVariable],[value]]}}}/>
    """>> The following example extracts the `srcVariables.params` without pretty printing using <<.olink jsonextract>> @@ -37,5 +37,5 @@ The following example extracts the `srcVariables.params` without pretty printing \function tab() [charcode[9]] -
    <$text text={{{[[fn.test]jsonvariable[]jsonextract[srcVariable],[params]format:json]}}}/>
    """>> +
    <$text text={{{[[fn.test]jsonvariables[]jsonextract[srcVariable],[params]format:json]}}}/>
    """>> diff --git a/editions/tw5.com/tiddlers/jsonvariable Operator.tid b/editions/tw5.com/tiddlers/jsonvariable Operator.tid index ea1afdc71..8ff20912f 100644 --- a/editions/tw5.com/tiddlers/jsonvariable Operator.tid +++ b/editions/tw5.com/tiddlers/jsonvariable Operator.tid @@ -1,4 +1,4 @@ -caption: jsonvariable +caption: jsonvariables created: 20240506131935424 modified: 20240506151517068 op-input: a selection variable names @@ -7,7 +7,7 @@ op-parameter: one or more indexes of the property to retrieve op-parameter-name: R op-purpose: retrieve the JSON string from a ~TiddlyWiki variable tags: [[Filter Operators]] [[JSON Operators]] -title: jsonvariable Operator +title: jsonvariables Operator type: text/vnd.tiddlywiki \procedure testProc() [[aa aa]] bb @@ -16,9 +16,9 @@ type: text/vnd.tiddlywiki <<.from-version "5.3.4">> -The <<.op jsonvariable>> operator is used to retrieve variables as JSON substrings. See also the following related operators: +The <<.op jsonvariables>> operator is used to retrieve variables as JSON substrings. See also the following related operators: -Properties within a JSON object are identified by a sequence of indexes. In the following example, we use a procedure: `testProc` and a function: `fn.test` to show the possibilities of <<.op jsonvariable>>. The `tab`-function is needed for the <<.olink format>> ooperator, which is used to "pretty-print" the output. +Properties within a JSON object are identified by a sequence of indexes. In the following example, we use a procedure: `testProc` and a function: `fn.test` to show the possibilities of <<.op jsonvariables>>. The `tab`-function is needed for the <<.olink format>> ooperator, which is used to "pretty-print" the output. ``` \procedure testProc() [[aa aa]] bb @@ -26,12 +26,12 @@ Properties within a JSON object are identified by a sequence of indexes. In the \function tab() [charcode[9]] -
    <$text text={{{[[fn.test]jsonvariable[]format:json]}}}/>
    +
    <$text text={{{[[fn.test]jsonvariables[]format:json]}}}/>
    ``` Which results to: -
    <$text text={{{[[fn.test]jsonvariable[]format:json]}}}/>
    +
    <$text text={{{[[fn.test]jsonvariables[]format:json]}}}/>
    Also see: @@ -42,4 +42,4 @@ Also see: Every TW variable has this internal structure, which we can use to extract the info we need. -!! <<.operator-examples "jsonvariable">> \ No newline at end of file +!! <<.operator-examples "jsonvariables">> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/test-jsonvariable-conat.tid b/editions/tw5.com/tiddlers/test-jsonvariable-conat.tid index 274da207f..96bebf2d3 100644 --- a/editions/tw5.com/tiddlers/test-jsonvariable-conat.tid +++ b/editions/tw5.com/tiddlers/test-jsonvariable-conat.tid @@ -1,35 +1,35 @@ created: 20240506101435113 modified: 20240506140610448 tags: -title: test-jsonvariable-conat +title: test-jsonvariables-conat type: text/vnd.tiddlywiki ''Nice to have'' <<.example 1 """\function tab() [charcode[9]] -
    <$text text={{{[[.concat]jsonvariable[]]}}}/>
    +
    <$text text={{{[[.concat]jsonvariables[]]}}}/>
    """>> ''Human readable version'' <<.example 2 """\function tab() [charcode[9]] -
    <$text text={{{[[.concat]jsonvariable[]format:json]}}}/>
    +
    <$text text={{{[[.concat]jsonvariables[]format:json]}}}/>
    """>> ''Function definition'' <<.example 3 """\function tab() [charcode[9]] -
    <$text text={{{[[.concat]jsonvariable[]jsonextract[srcVariable],[value]format:json]}}}/>
    +
    <$text text={{{[[.concat]jsonvariables[]jsonextract[srcVariable],[value]format:json]}}}/>
    """>> ''Get parameters'' <<.example 4 """\function tab() [charcode[9]] -
    <$text text={{{[[.concat]jsonvariable[]jsonextract[srcVariable],[params]format:json]}}}/>
    +
    <$text text={{{[[.concat]jsonvariables[]jsonextract[srcVariable],[params]format:json]}}}/>
    """>> ''Expected''