diff --git a/core/modules/filters/jsonvariables.js b/core/modules/filters/jsonvariables.js index 6bacfe562..cb5e1a575 100644 --- a/core/modules/filters/jsonvariables.js +++ b/core/modules/filters/jsonvariables.js @@ -1,5 +1,5 @@ /*\ -title: $:/core/modules/filters/jsonvariables.js +title: $:/core/modules/filters/jsonvariable.js type: application/javascript module-type: filteroperator @@ -16,7 +16,7 @@ Display as JSON with basic formatting /* Export our filter function */ -exports.jsonvariables = function(source,operator,options) { +exports.jsonvariable = 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 897bc77aa..c1c10943c 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={{{ [jsonvariables[]jsonextract[srcVariable],[value]] }}}/>
    +
    <$text text={{{ [jsonvariable[]jsonextract[srcVariable],[value]] }}}/>
    <% endif %>
    <$text text={{{ [getvariable[]] }}}/>
  • @@ -235,7 +235,7 @@ tags: $:/tags/Global <> <% endif %> <% if [prefix[\function]] %> - <$codeblock code={{{ [jsonvariables[]jsonextract[srcVariable],[value]] }}}/> + <$codeblock code={{{ [jsonvariable[]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 c67b78ccc..59090ac91 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: 20240523052607425 -tags: [[Operator Examples]] [[jsonvariables Operator]] -title: jsonvariables Operator (Examples) +tags: [[Operator Examples]] [[jsonvariable Operator]] +title: jsonvariable Operator (Examples) type: text/vnd.tiddlywiki -The following example shows the "internal" structure of the `fn.test` function defined in <<.olink jsonvariables>> operator +The following example shows the "internal" structure of the `fn.test` function defined in <<.olink jsonvariable>> operator <<.example 1 """\procedure testProc() [[aa aa]] bb \function fn.test(splitChar:" " not-used) [enlistformat:titlelist[]] -
    <$text text={{{[[fn.test]jsonvariables[]]}}}/>
    +
    <$text text={{{[[fn.test]jsonvariable[]]}}}/>
    """>> 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]jsonvariables[]format:json]}}}/>
    +
    <$text text={{{[[fn.test]jsonvariable[]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]jsonvariables[]jsonextract[srcVariable],[value]]}}}/>
    +
    <$text text={{{[[fn.test]jsonvariable[]jsonextract[srcVariable],[value]]}}}/>
    """>> The following example extracts the `srcVariables.params` with pretty printing using <<.olink jsonextract>> @@ -37,5 +37,5 @@ The following example extracts the `srcVariables.params` with pretty printing us \function tab() [charcode[9]] -
    <$text text={{{[[fn.test]jsonvariables[]jsonextract[srcVariable],[params]format:json]}}}/>
    """>> +
    <$text text={{{[[fn.test]jsonvariable[]jsonextract[srcVariable],[params]format:json]}}}/>
    """>> diff --git a/editions/tw5.com/tiddlers/jsonvariable Operator.tid b/editions/tw5.com/tiddlers/jsonvariable Operator.tid index 8ff20912f..ea1afdc71 100644 --- a/editions/tw5.com/tiddlers/jsonvariable Operator.tid +++ b/editions/tw5.com/tiddlers/jsonvariable Operator.tid @@ -1,4 +1,4 @@ -caption: jsonvariables +caption: jsonvariable 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: jsonvariables Operator +title: jsonvariable 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 jsonvariables>> operator is used to retrieve variables as JSON substrings. See also the following related operators: +The <<.op jsonvariable>> 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 jsonvariables>>. 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 jsonvariable>>. 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]jsonvariables[]format:json]}}}/>
    +
    <$text text={{{[[fn.test]jsonvariable[]format:json]}}}/>
    ``` Which results to: -
    <$text text={{{[[fn.test]jsonvariables[]format:json]}}}/>
    +
    <$text text={{{[[fn.test]jsonvariable[]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 "jsonvariables">> \ No newline at end of file +!! <<.operator-examples "jsonvariable">> \ 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 96bebf2d3..274da207f 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-jsonvariables-conat +title: test-jsonvariable-conat type: text/vnd.tiddlywiki ''Nice to have'' <<.example 1 """\function tab() [charcode[9]] -
    <$text text={{{[[.concat]jsonvariables[]]}}}/>
    +
    <$text text={{{[[.concat]jsonvariable[]]}}}/>
    """>> ''Human readable version'' <<.example 2 """\function tab() [charcode[9]] -
    <$text text={{{[[.concat]jsonvariables[]format:json]}}}/>
    +
    <$text text={{{[[.concat]jsonvariable[]format:json]}}}/>
    """>> ''Function definition'' <<.example 3 """\function tab() [charcode[9]] -
    <$text text={{{[[.concat]jsonvariables[]jsonextract[srcVariable],[value]format:json]}}}/>
    +
    <$text text={{{[[.concat]jsonvariable[]jsonextract[srcVariable],[value]format:json]}}}/>
    """>> ''Get parameters'' <<.example 4 """\function tab() [charcode[9]] -
    <$text text={{{[[.concat]jsonvariables[]jsonextract[srcVariable],[params]format:json]}}}/>
    +
    <$text text={{{[[.concat]jsonvariable[]jsonextract[srcVariable],[params]format:json]}}}/>
    """>> ''Expected''