diff --git a/editions/tw5.com/tiddlers/features/VariableFormat.tid b/editions/tw5.com/tiddlers/features/VariableFormat.tid index 90178a36e..539a48908 100644 --- a/editions/tw5.com/tiddlers/features/VariableFormat.tid +++ b/editions/tw5.com/tiddlers/features/VariableFormat.tid @@ -1,5 +1,5 @@ created: 20240219185725834 -modified: 20240429134515751 +modified: 20240501103053921 tags: Features title: VariableFormat type: text/vnd.tiddlywiki @@ -8,9 +8,9 @@ type: text/vnd.tiddlywiki Finding "self explaining" variable names for functions, procedures, widgets and macros is difficult. So if variables are listed with <<.mlink dumpvariables>>, <<.mlink search-variables>> or from the "Variables" tab in the $:/AdvancedSearch, it's not obvious ''how'' they work and how they are defined. -The <<.olink variables>> operator returns all "visible" variables from the current context, depending on where the filter run is executed. The <<.olink getvariable>> allows us to return the "text" or the "value" of variables. But this information is not enough to get a good understanding of existing variables. +The <<.olink variables>> operator returns all "visible" variables from the current context, depending on where the filter run is executed. The getvariable-operator allows us to return the "text" or the "value" of variables. But this information is not enough to get a good understanding of existing variables. -So using <<.olink getvariable>> operator in combination with the <<.olink format>> operator we are able to improve information in variable listings. +So using getvariable-operator in combination with the <<.olink format>> operator we are able to improve information in variable listings. |Token |Substituted Value |h |`$type$` |variabe type eg: `\function`, `\procedure` and so on | @@ -18,3 +18,5 @@ So using <<.olink getvariable>> operator in combination with the <<.olink format |`$params$` |returns a list of parameters, which are defined with functions, procedures ... | |`$firstLine$` |returns the first line of the variable content-type as used by <<.olink getvariable>> | |`$varType$` |returns `var`, `fn`, ` proc`, ` macro` or ` widget` which can be used with the <<.olink variables>> operator | + +See: <<.mlink dumpvariables>>, <<.mlink search-variables>> or $:/AdvancedSearch diff --git a/editions/tw5.com/tiddlers/filters/examples/format Operator (Examples).tid b/editions/tw5.com/tiddlers/filters/examples/format Operator (Examples).tid index b6ad505a1..c9025b1aa 100644 --- a/editions/tw5.com/tiddlers/filters/examples/format Operator (Examples).tid +++ b/editions/tw5.com/tiddlers/filters/examples/format Operator (Examples).tid @@ -1,5 +1,5 @@ created: 20201020102735123 -modified: 20230226135641976 +modified: 20240501103205895 tags: [[Operator Examples]] [[format Operator]] title: format Operator (Examples) type: text/vnd.tiddlywiki @@ -29,9 +29,12 @@ A JSON string formatted as JSON – note how the JSON string is normalised to re <<.tip "To create a string to save a [[title list|Title List]] into a list field, use `format:titlelist[]` with the [[join operator|join Operator]]">> <<.operator-example 8 """[tag[TableOfContents]format:titlelist[]join[ ]]""">> -For example, to save titles tagged `TableOfContents` to the titles field of the tiddler [[format titlelist test]]: +A variable formatted as procedure definition. Also see: [[search-variables Macro]] +<<.operator-example 9 """[[.attr]format:variable[$type$ $name$($params$) $firstLine$]]""">> + +For example, to save titles tagged `TableOfContents` to the titles field of the tiddler [[format titlelist test]]: <$macrocall $name='wikitext-example-without-html' src='<$button>Try it -<$action-setfield $tiddler="format titlelist test" titles={{{ [tag[TableOfContents]format:titlelist[]join[ ]] }}}/> +<$action-setfield $tiddler="format titlelist test" text={{{ [tag[TableOfContents]format:titlelist[]join[ ]] }}}/> '/> diff --git a/editions/tw5.com/tiddlers/filters/variables.tid b/editions/tw5.com/tiddlers/filters/variables.tid index 2b9c7ee16..e9addd272 100644 --- a/editions/tw5.com/tiddlers/filters/variables.tid +++ b/editions/tw5.com/tiddlers/filters/variables.tid @@ -1,6 +1,6 @@ caption: variables created: 20190330100101453 -modified: 20240429134329720 +modified: 20240501101748198 op-input: ignored op-output: the names of all the actively defined variables op-parameter: <<.from-version "5.3.4">> whitespace separated list of variable-types @@ -18,14 +18,14 @@ type: text/vnd.tiddlywiki ''Possible Suffixes: <<.place S>>:'' <<.from-version "5.3.4">> -* ''sort'' (default): By default the returned list is alphabetically sorted +* ''alphabetical'' (default): By default the returned list is alphabetically sorted * ''raw'': The variable list will be returned as created. The variables "near" the filter run will show up first. So if variables are defined in the tiddler, where the <<.mlink dumpvariables>> or <<.mlink search-variables>> macros are executed, they will be listed first. ''Parameters <<.place T>>:'' <<.from-version "5.3.4">> -The parameters <<.place T>> allow a "whitespace separated" list of variable codes that should be listed +The parameters <<.place T>> allow a ''whitespace separated list'' of variable codes that should be listed -* Default is `all` - `fn, var, proc, macro, widget` +* Default is `all` or `fn, var, proc, macro, widget` * ''all'' ... If set it takes precedence and will show all variables * ''fn'' ... Will only show variables defined as functions eg: `\function test-01()` diff --git a/editions/tw5.com/tiddlers/macros/DumpVariablesMacro.tid b/editions/tw5.com/tiddlers/macros/DumpVariablesMacro.tid index ccc15eb13..d2256d7e6 100644 --- a/editions/tw5.com/tiddlers/macros/DumpVariablesMacro.tid +++ b/editions/tw5.com/tiddlers/macros/DumpVariablesMacro.tid @@ -1,6 +1,6 @@ caption: dumpvariables created: 20140908104107181 -modified: 20240427121039507 +modified: 20240501101941520 tags: Macros [[Core Macros]] title: dumpvariables Macro type: text/vnd.tiddlywiki @@ -28,6 +28,6 @@ The following parameters are <<.from-version "5.3.4">> ; format : Format the output string using the VariableFormat. Defaults to `$type$ $name$($params$) $firstLine$`. -!!! <<.macro-examples "dumpvariables">> - Also see: [[search-variables Macro]] + +!!! <<.macro-examples "dumpvariables">> diff --git a/editions/tw5.com/tiddlers/macros/search-variables Macro.tid b/editions/tw5.com/tiddlers/macros/search-variables Macro.tid index 2e98779e0..6c0106842 100644 --- a/editions/tw5.com/tiddlers/macros/search-variables Macro.tid +++ b/editions/tw5.com/tiddlers/macros/search-variables Macro.tid @@ -1,6 +1,6 @@ caption: search-variables created: 20240427120451313 -modified: 20240427123016441 +modified: 20240501101929800 tags: Macros [[Core Macros]] title: search-variables Macro type: text/vnd.tiddlywiki @@ -29,6 +29,6 @@ It is useful for debugging and exploring ~TiddlyWiki's internals. ; format : Format the output string using the VariableFormat. Defaults to `$type$ $name$($params$) $firstLine$`. -!!! <<.macro-examples "search-variables">> - Also see: [[dumpvariables Macro]] + +!!! <<.macro-examples "search-variables">>