From 7aba21c1be8d5e890c4f0efef5dbd2f7d711bef4 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Fri, 9 Sep 2022 14:15:56 +0100 Subject: [PATCH] Docs updates --- .../tw5.com/tiddlers/widgets/ErrorWidget.tid | 17 +++++++++ .../tw5.com/tiddlers/widgets/FillWidget.tid | 19 ++++++++++ .../tiddlers/widgets/MacroCallWidget.tid | 35 +++++-------------- .../tw5.com/tiddlers/widgets/SetWidget.tid | 3 +- .../tw5.com/tiddlers/widgets/SlotWidget.tid | 19 ++++++++++ 5 files changed, 65 insertions(+), 28 deletions(-) create mode 100644 editions/tw5.com/tiddlers/widgets/ErrorWidget.tid create mode 100644 editions/tw5.com/tiddlers/widgets/FillWidget.tid create mode 100644 editions/tw5.com/tiddlers/widgets/SlotWidget.tid diff --git a/editions/tw5.com/tiddlers/widgets/ErrorWidget.tid b/editions/tw5.com/tiddlers/widgets/ErrorWidget.tid new file mode 100644 index 000000000..392afea40 --- /dev/null +++ b/editions/tw5.com/tiddlers/widgets/ErrorWidget.tid @@ -0,0 +1,17 @@ +caption: error +created: 20220909111836951 +modified: 20220909111836951 +tags: Widgets +title: ErrorWidget +type: text/vnd.tiddlywiki + +<<.from-version "5.3.0">> The <<.wlink ErrorWidget>> widget is used by the core to display error messages such as the recursion errors reported by the <<.wlink TranscludeWidget>> widget. + +The <<.wlink ErrorWidget>> does not provide any useful functionality to end users. It is only required by the core for technical reasons. + +! Content and Attributes + +The content of the <<.wlink ErrorWidget>> widget is ignored. + +|!Attribute |!Description | +|$message |The error message | diff --git a/editions/tw5.com/tiddlers/widgets/FillWidget.tid b/editions/tw5.com/tiddlers/widgets/FillWidget.tid new file mode 100644 index 000000000..754c262a9 --- /dev/null +++ b/editions/tw5.com/tiddlers/widgets/FillWidget.tid @@ -0,0 +1,19 @@ +caption: fill +created: 20220909111836951 +modified: 20220909111836951 +tags: Widgets +title: FillWidget +type: text/vnd.tiddlywiki + +! Introduction + +<<.from-version "5.3.0">> The <<.wlink FillWidget>> widget is used within a <<.wlink TranscludeWidget>> widget to specify the content that should be copied to the named "slot". Slots are defined by the <<.wlink SlotWidget>> widget within the transcluded content. + +See the <<.wlink TranscludeWidget>> widget for details. + +! Attributes + +The content of the <<.wlink FillWidget>> widget is used as the content to be passed to the transclusion. + +|!Attribute |!Description | +|$name |The name of the slot to be filled | diff --git a/editions/tw5.com/tiddlers/widgets/MacroCallWidget.tid b/editions/tw5.com/tiddlers/widgets/MacroCallWidget.tid index e163c1d41..c853ea2f9 100644 --- a/editions/tw5.com/tiddlers/widgets/MacroCallWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/MacroCallWidget.tid @@ -1,48 +1,29 @@ caption: macrocall created: 20131024141900000 -modified: 20220122193731433 +modified: 20220909111836951 tags: Widgets title: MacroCallWidget type: text/vnd.tiddlywiki -! Introduction +<<.from-version "5.3.0">> The <<.wlink MacroCallWidget>> widget is now deprecated. While it will continue to work, users are advised to use the <<.wlink TranscludeWidget>> widget, converting the `$name` attribute to `$variable`. -The macro call widget provides a more flexible alternative syntax for invoking macros compared to the usual `<>` syntax documented in [[Macros in WikiText]]. - -For example, a macro called `italicise` that takes a single parameter called `text` would usually be invoked like this: +For example, ``` -<> -<> +<$macrocall $name="my-macro" my-parameter="Elephant"/> ``` -The same macro can be invoked using the macro call widget like this: +should be changed to: ``` -<$macrocall $name="italicise" text="Text to be made into italics"/> -<$macrocall $name="italicise" text={{Title of tiddler containing text to be italicised}}/> -<$macrocall $name="italicise" text=<>/> +<$transclude $variable="my-macro" my-parameter="Elephant"/> ``` -The advantages of the widget formulation are: - -* Macro parameters are specified as widget attributes, thus allowing indirection via `{{title!!field}}`, `<>` or `{{{filter}}}` -* The output format can be chosen from several options: -** `text/html` wikifies the result of the macro -** `text/plain` wikifies the result of the macro and then extracts the plain text characters (ie. ignoring HTML tags) -** <<.from-version "5.1.23">> `text/raw` returns the result of the macro, without wikification - -You can see several examples of the macro call widget within the core: - -* Listing module information: [[$:/snippets/modules]] -* Listing field information: [[$:/snippets/allfields]] -* Generating `data:` URIs: [[$:/themes/tiddlywiki/starlight/styles.tid]] - -See also [[WikiText parser mode: macro examples]] +Internally, the <<.wlink MacroCallWidget>> widget is implemented via the <<.wlink TranscludeWidget>> widget. ! Content and Attributes -The content of the `<$macrocall>` widget is ignored. +The content of the <<.wlink MacroCallWidget>> widget is ignored. |!Attribute |!Description | |$name |Name of the macro to invoke | diff --git a/editions/tw5.com/tiddlers/widgets/SetWidget.tid b/editions/tw5.com/tiddlers/widgets/SetWidget.tid index fe05e8faa..c01736e4c 100644 --- a/editions/tw5.com/tiddlers/widgets/SetWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/SetWidget.tid @@ -1,6 +1,6 @@ caption: set created: 20131115182700000 -modified: 20220523075522407 +modified: 20220909111836951 tags: Widgets title: SetWidget type: text/vnd.tiddlywiki @@ -23,6 +23,7 @@ The content of the `<$set>` widget is the scope for the value assigned to the va |filter |An optional filter to be evaluated and assigned to the variable (see "Filtered List Variable Assignment" below). The variable can be used with the <<.olink enlist>> operator | |select |<<.from-version "5.1.14">> An optional zero-based index of the item to return from the filter output (see below) | |emptyValue |The value to assign to the variable if the specified value is missing or empty (see below) | +|conditional |<<.from-version "5.3.0">> If set to "yes" then the assignment only occurs if the variable does not already have a value (defaults to "no") | <<.tip """If the value of your variable is enclosed in double square brackets this might indicate that you are returning a list of values from the filter. To use a single title from the filter output without the double square brackets see ''Filtered Item Variable Assignment'' below.""">> diff --git a/editions/tw5.com/tiddlers/widgets/SlotWidget.tid b/editions/tw5.com/tiddlers/widgets/SlotWidget.tid new file mode 100644 index 000000000..eab3784c6 --- /dev/null +++ b/editions/tw5.com/tiddlers/widgets/SlotWidget.tid @@ -0,0 +1,19 @@ +caption: slot +created: 20220909111836951 +modified: 20220909111836951 +tags: Widgets +title: SlotWidget +type: text/vnd.tiddlywiki + +! Introduction + +<<.from-version "5.3.0">> The <<.wlink SlotWidget>> widget is used within transcluded content to mark "slots" that the transcluding widget can fill with the <<.wlink FillWidget>> widget. + +See the <<.wlink TranscludeWidget>> widget for details. + +! Attributes + +The content of the <<.wlink SlotWidget>> widget is used as a fallback for the slot content if the corresponding <<.wlink FillWidget>> widget is not found. + +|!Attribute |!Description | +|$name |The name of the slot being defined |