From 189b6016b62c54087ce70d5923c293a2efa22698 Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Sat, 27 Jul 2024 15:43:10 +0200 Subject: [PATCH 1/3] Fix empty-tag-node-template. removing redundant DOM elements if no list is shown (#8432) --- editions/tw5.com/tiddlers/empty-tag-node-template.tid | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/editions/tw5.com/tiddlers/empty-tag-node-template.tid b/editions/tw5.com/tiddlers/empty-tag-node-template.tid index 6827c6fe2..79905b77c 100644 --- a/editions/tw5.com/tiddlers/empty-tag-node-template.tid +++ b/editions/tw5.com/tiddlers/empty-tag-node-template.tid @@ -5,7 +5,8 @@ tags: $:/tags/ViewTemplate title: $:/editions/tw5.com/empty-tag-node-template type: -<$list filter='[!has[text]!has[tags]] :filter[tagging[]]'> +<% if [!has[text]!has[tags]tagging[]] %> The following tiddlers are tagged with <>: - -<!has[text]!has[tags]tagging[]]" class:"multi-columns">> \ No newline at end of file + +<!has[text]!has[tags]tagging[]]" class:"multi-columns">> +<% endif %> \ No newline at end of file From 6002235db722b7fecf317a4420ff3e6f026ede52 Mon Sep 17 00:00:00 2001 From: Mohammad Rahmani <830394+kookma@users.noreply.github.com> Date: Sun, 28 Jul 2024 16:10:58 +0330 Subject: [PATCH 2/3] Replace Macro with Myfun when Calling Example Function (#8277) --- editions/tw5.com/tiddlers/functions/Functions.tid | 14 +++++++------- ...es depends on how the variable was declared.tid | 10 +++++----- ...ur of variables invoked via normal wikitext.tid | 4 ++-- ... of variables invoked via widget attributes.tid | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/editions/tw5.com/tiddlers/functions/Functions.tid b/editions/tw5.com/tiddlers/functions/Functions.tid index dadce73a1..028747a34 100644 --- a/editions/tw5.com/tiddlers/functions/Functions.tid +++ b/editions/tw5.com/tiddlers/functions/Functions.tid @@ -1,5 +1,5 @@ created: 20221009124003601 -modified: 20230419103154328 +modified: 20240619211228560 tags: Concepts Reference title: Functions type: text/vnd.tiddlywiki @@ -11,17 +11,17 @@ type: text/vnd.tiddlywiki Functions are usually defined with the [[Pragma: \function]]: ``` -\function my-function(parameter:"2") -[multiply[1.5]] +\function myfun(param:"2") +[multiply[1.5]] \end ``` Functions can be invoked in several ways: -* Directly transclude functions with the syntax `<>` -* Assign functions to widget attributes with the syntax `
>>` -* Invoke functions via the [[function Operator]] with the syntax `[function[myfn],[value],...]` -* Directly invoke functions whose names contain a period as custom filter operators with the syntax `[my.fn[value]]` or `[.myfn[value]]` +* Directly transclude functions with the syntax `<>` +* Assign functions to widget attributes with the syntax `
>>` +* Invoke functions via the [[function Operator]] with the syntax `[function[myfun],[value],...]` +* Directly invoke functions whose names contain a period as custom filter operators with the syntax `[my.fun[value]]` or `[.myfun[value]]` !! How Functions Work diff --git a/editions/tw5.com/tiddlers/variables/Behaviour of invoked variables depends on how the variable was declared.tid b/editions/tw5.com/tiddlers/variables/Behaviour of invoked variables depends on how the variable was declared.tid index 319bf2c78..98fbf6b28 100644 --- a/editions/tw5.com/tiddlers/variables/Behaviour of invoked variables depends on how the variable was declared.tid +++ b/editions/tw5.com/tiddlers/variables/Behaviour of invoked variables depends on how the variable was declared.tid @@ -1,5 +1,5 @@ created: 20230726145210484 -modified: 20230726145757234 +modified: 20240619211734149 tags: [[Variable Usage]] title: Behaviour of invoked variables depends on how the variable was declared type: text/vnd.tiddlywiki @@ -8,19 +8,19 @@ type: text/vnd.tiddlywiki \procedure p1(a1) $a1$ - <<__a1__>> - <> \function f1(a1) "$a1$" "-" [<__a1__>] ="-" [] :and[join[ ]] -Invoked in normal wikitext context: `<$transclude $variable=macro/>` or `<>` +Invoked in normal wikitext context: `<$transclude $variable=myvar/>` or `<>` {{Behaviour of variables invoked via normal wikitext}} -Invoked via widget attribute: `
>/>` +Invoked via widget attribute: `
>/>` {{Behaviour of variables invoked via widget attributes}} -Invoked via filter operator parameter: `[]` +Invoked via filter operator parameter: `[]` {{Behaviour of variables invoked via filter operator parameter}} -Invoked via function call in a filter expression: `[function[macro]]` +Invoked via function call in a filter expression: `[function[.myfun]]` {{Behaviour of variables invoked via filter expression function call}} diff --git a/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via normal wikitext.tid b/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via normal wikitext.tid index 0caa74c26..0eae9acff 100644 --- a/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via normal wikitext.tid +++ b/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via normal wikitext.tid @@ -1,5 +1,5 @@ created: 20230726142925020 -modified: 20230726150648189 +modified: 20240619211452297 tags: [[Variable Usage]] title: Behaviour of variables invoked via normal wikitext type: text/vnd.tiddlywiki @@ -8,4 +8,4 @@ type: text/vnd.tiddlywiki |!how declared|!behaviour| |\define|All wikitext and variable substitution and textual substitution takes place| |<<.wlink SetWidget>>, <<.wlink LetWidget>>, <<.wlink VarsWidget>>, \procedure, \widget|All wikitext and variable substitution takes place| -|\function|Invoking a function in this way (`<>`) is a synonym for `<$text text={{{[function[macro]]}}}/>`. As with any filtered transclusion (i.e. triple curly braces), all results except the first are discarded| \ No newline at end of file +|\function|Invoking a function in this way (`<<.myfun>>`) is a synonym for `<$text text={{{[function[.myfun]]}}}/>`. As with any filtered transclusion (i.e. triple curly braces), all results except the first are discarded| \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via widget attributes.tid b/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via widget attributes.tid index 3bf06e219..3784c94e3 100644 --- a/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via widget attributes.tid +++ b/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via widget attributes.tid @@ -1,5 +1,5 @@ created: 20230726143332803 -modified: 20230726150616232 +modified: 20240619210723396 tags: [[Variable Usage]] title: Behaviour of variables invoked via widget attributes type: text/vnd.tiddlywiki @@ -8,4 +8,4 @@ type: text/vnd.tiddlywiki |!how declared|!behaviour| |\define|Textual substitution of parameters is performed on the body text. No further processing takes place. The result after textual substitution is used as the attribute's value| |<<.wlink SetWidget>>, <<.wlink LetWidget>>, <<.wlink VarsWidget>>, \procedure, \widget|Body text is retrieved as-is and used as the attribute's value.| -|\function|When a function is invoked as `
>/>`, it is a synonym for `
`. As with any filtered transclusion (i.e. triple curly braces), all results except the first are discarded. That first result is used as the attribute's value. Note that functions are recursively processed even when invoked in this form. In other words a filter expression in a function can invoke another function and the processing will continue| \ No newline at end of file +|\function|When a function (e.g. `.myfun`) is invoked as `
>/>`, it is a synonym for `
`. As with any filtered transclusion (i.e. triple curly braces), all results except the first are discarded. That first result is used as the attribute's value. Note that functions are recursively processed even when invoked in this form. In other words a filter expression in a function can invoke another function and the processing will continue| \ No newline at end of file From b452a1ee00cddd518436b4991b10a9395177f5c4 Mon Sep 17 00:00:00 2001 From: Mohammad Rahmani <830394+kookma@users.noreply.github.com> Date: Sun, 28 Jul 2024 16:13:20 +0330 Subject: [PATCH 3/3] Wikitext Procedures (#8390) --- editions/tw5.com/tiddlers/system/wikitext-macros.tid | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/editions/tw5.com/tiddlers/system/wikitext-macros.tid b/editions/tw5.com/tiddlers/system/wikitext-macros.tid index 9746af1ae..e4a898ad8 100644 --- a/editions/tw5.com/tiddlers/system/wikitext-macros.tid +++ b/editions/tw5.com/tiddlers/system/wikitext-macros.tid @@ -1,6 +1,6 @@ code-body: yes created: 20150117184156000 -modified: 20240315144208842 +modified: 20240716181836632 tags: $:/tags/Macro title: $:/editions/tw5.com/wikitext-macros type: text/vnd.tiddlywiki @@ -80,12 +80,12 @@ type: text/vnd.tiddlywiki \end \procedure tw-code(tiddler) -<$codeblock language={{$tiddler$!!type}} code={{$tiddler$}}/> +<$codeblock language={{{ [get[type]] }}} code={{{ [get[text]] }}}/> \end \procedure tw-code-link(tiddler) -[[$tiddler$]]: -<> +<$link to=<>/>: +<$transclude $variable=tw-code tiddler=<> /> \end \procedure flex-card(class,bordercolor:"",backgroundcolor:"",textcolor:"",imageField:"image",captionField:"caption",subtitle:"",descriptionField:"description",linkField:"link")