From 28c1e6bfc3b4a842323ab6cc03c34c17a93e45e9 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Wed, 7 Dec 2022 09:43:39 +0000 Subject: [PATCH 1/4] Docs update for nested macro definitions Suggested by @kookma in https://github.com/FlashSystems/TiddlyWiki5/commit/bcb3b06d60a3b616083e9df36fc487cbbbf8abb7#commitcomment-91922651 and https://github.com/FlashSystems/TiddlyWiki5/commit/bcb3b06d60a3b616083e9df36fc487cbbbf8abb7#commitcomment-91922974 --- .../Macro Definitions in WikiText.tid | 41 +++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/editions/tw5.com/tiddlers/wikitext/Macro Definitions in WikiText.tid b/editions/tw5.com/tiddlers/wikitext/Macro Definitions in WikiText.tid index d5c7ce509..cae2b2009 100644 --- a/editions/tw5.com/tiddlers/wikitext/Macro Definitions in WikiText.tid +++ b/editions/tw5.com/tiddlers/wikitext/Macro Definitions in WikiText.tid @@ -1,6 +1,6 @@ caption: Macro Definitions created: 20150220181617000 -modified: 20221022135909352 +modified: 20221207094236472 tags: WikiText title: Macro Definitions in WikiText type: text/vnd.tiddlywiki @@ -19,22 +19,6 @@ Alternatively, the entire definition can be presented on a single line without a \define sayhi(name:"Bugs Bunny") Hi, I'm $name$. ``` -Macro definitions can be nested by specifying the name of the macro in the `\end` marker. For example: - -< -\end actions -<$button actions=<>> -$caption$ - -\end special-button - -<> -""">> - -A more formal [[presentation|Macro Definition Syntax]] of this syntax is also available. - !! Accessing variables and parameters Inside the macro there are several methods for accessing variables defined outside of the macro or parameters from the macro parameter list. @@ -93,3 +77,26 @@ To make a macro available to all tiddlers, define it in a tiddler that has the t It is also possible to write a macro as a [[JavaScript module|https://tiddlywiki.com/dev/index.html#JavaScript%20Macros]]. ~JavaScript macros are available to all tiddlers, and offer the maximum flexibility. A tiddler can manually import macro definitions from a [[selection|Title Selection]] of other tiddlers by using the <<.wlink ImportVariablesWidget>> widget. + +!! Nested Macro Definitions + +Macro definitions can be nested to any number of required levels by specifying the name of the macro in the `\end` marker. Nested macro definitions must appear at the start of the definition that contains them. For example: + +< +\end actions +<$button actions=<>> +$caption$ + +\end special-button + +<> +""">> + +Note that the textual substitution of macro parameters that occurs when the outer macro is rendered will apply to the nested definitions as well. That generally means that textual substitution of macro parameters should not be used within nested macros. + +Parameters of nested macros can also be accessed via the `<<__variablename__>>` syntax. As ordinary variables, these parameters are available within nested child macros (and grandchildren etc). + +A more formal [[presentation|Macro Definition Syntax]] of this syntax is also available. + From 9f867ad51ee020398f6dd59a20e345156354b89f Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Wed, 7 Dec 2022 17:10:45 +0000 Subject: [PATCH 2/4] Dynannotate: Fix undefined class --- plugins/tiddlywiki/dynannotate/modules/dynannotate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/tiddlywiki/dynannotate/modules/dynannotate.js b/plugins/tiddlywiki/dynannotate/modules/dynannotate.js index 00314dab2..cd47c07c7 100644 --- a/plugins/tiddlywiki/dynannotate/modules/dynannotate.js +++ b/plugins/tiddlywiki/dynannotate/modules/dynannotate.js @@ -332,7 +332,7 @@ DynannotateWidget.prototype.applySnippets = function() { // Output the match container.appendChild($tw.utils.domMaker("span",{ text: textMap.string.slice(match.startPos,match.endPos), - "class": "tc-dynannotate-snippet-highlight " + self.getAttribute("searchClass") + "class": "tc-dynannotate-snippet-highlight " + self.getAttribute("searchClass","") })); // Does the context of this match merge into the next? merged = index < matches.length - 1 && matches[index + 1].startPos - match.endPos <= 2 * contextLength; From 17a1ae23eb59cfa1feefa106ccd810988a7735a5 Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Wed, 7 Dec 2022 18:14:12 +0100 Subject: [PATCH 3/4] Fix truncated search results on small screens (#7099) --- themes/tiddlywiki/vanilla/base.tid | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index d2fe757f6..7dccf1894 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1999,6 +1999,15 @@ html body.tc-body.tc-single-tiddler-window { margin: auto; } +/* Make search dropdown visible on small screens. issue #7003 */ +@media (max-width: <>) { + + .tc-sidebar-search .tc-block-dropdown-wrapper { + position: initial; + } + +} + /* ** Modals */ From bef11fe6a25fb849dee40c4aa4337d6a30daf0b4 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Wed, 7 Dec 2022 22:02:58 +0000 Subject: [PATCH 4/4] Allow overriding the coreURL for the external JS builds Fixes #7096 --- core/templates/external-js/save-all-external-js.tid | 6 ++++-- core/templates/external-js/save-offline-external-js.tid | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/templates/external-js/save-all-external-js.tid b/core/templates/external-js/save-all-external-js.tid index a41cc0682..cd15cedc3 100644 --- a/core/templates/external-js/save-all-external-js.tid +++ b/core/templates/external-js/save-all-external-js.tid @@ -4,5 +4,7 @@ title: $:/core/save/all-external-js \define saveTiddlerFilter() [is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$ \end -\define coreURL() %24%3A%2Fcore%2Ftemplates%2Ftiddlywiki5.js -{{$:/core/templates/tiddlywiki5-external-js.html}} +\define defaultCoreURL() %24%3A%2Fcore%2Ftemplates%2Ftiddlywiki5.js +<$let coreURL={{{ [[coreURL]is[variable]thenelse] }}}> + {{$:/core/templates/tiddlywiki5-external-js.html}} + diff --git a/core/templates/external-js/save-offline-external-js.tid b/core/templates/external-js/save-offline-external-js.tid index 7175f7eea..2dfca5d52 100644 --- a/core/templates/external-js/save-offline-external-js.tid +++ b/core/templates/external-js/save-offline-external-js.tid @@ -4,5 +4,7 @@ title: $:/core/save/offline-external-js \define saveTiddlerFilter() [is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$ \end -\define coreURL() tiddlywikicore-$(version)$.js -{{$:/core/templates/tiddlywiki5-external-js.html}} +\define defaultCoreURL() tiddlywikicore-$(version)$.js +<$let coreURL={{{ [[coreURL]is[variable]thenelse] }}}> + {{$:/core/templates/tiddlywiki5-external-js.html}} +