1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-30 07:50:47 +00:00

Docs updates

This commit is contained in:
jeremy@jermolene.com 2022-09-09 14:15:56 +01:00
parent 32a6b6bb90
commit 7aba21c1be
5 changed files with 65 additions and 28 deletions

View File

@ -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 |

View File

@ -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 |

View File

@ -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 `<<macroname>>` 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,
```
<<italicise "Text to be made into italics">>
<<italicise text:"Text to be made into italics">>
<$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=<<textMaker "Another macro to generate the text to be italicised">>/>
<$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}}`, `<<macroname>>` 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 |

View File

@ -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.""">>

View File

@ -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 |