mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-07 18:39:57 +00:00
35 lines
1.6 KiB
Plaintext
35 lines
1.6 KiB
Plaintext
|
caption: genesis
|
||
|
created: 20220502144738010
|
||
|
modified: 20220502144738010
|
||
|
tags: Widgets
|
||
|
title: GenesisWidget
|
||
|
type: text/vnd.tiddlywiki
|
||
|
|
||
|
! Introduction
|
||
|
|
||
|
<<.from-version "5.2.3">> The genesis widget allows the dynamic construction of widgets, where the name and attributes of the widget can be dynamically determined, and do not need to be known in advance.
|
||
|
|
||
|
! Content and Attributes
|
||
|
|
||
|
The content of the `<$genesis>` widget is used as the content of the dynamically created widget.
|
||
|
|
||
|
|!Attribute |!Description |
|
||
|
|$type |The type of widget to create |
|
||
|
|$tag |The HTML tag to be used for "element" widgets |
|
||
|
|$names |An optional filter evaluating to the names of a list of variables to be applied to the widget |
|
||
|
|$values |An optional filter evaluating to the values corresponding to the list of names specified in `$names` |
|
||
|
|//{other attributes starting with $}// |Other attributes starting with a single dollar sign are reserved for future use |
|
||
|
|//{attributes starting with $$}// |Attributes starting with two dollar signs are appplied as attributes to the output widget, but with the attribute name changed to use a single dollar sign |
|
||
|
|//{attributes not starting with $}// |Any other attributes that do not start with a dollar are applied as attributes to the output widget |
|
||
|
|
||
|
Note that attributes explicitly specified take precedence over attributes with the same name specified in the `$names` filter.
|
||
|
|
||
|
! Examples
|
||
|
|
||
|
<$macrocall $name='wikitext-example-without-html'
|
||
|
src='<$set name="myTiddler" value="HelloThere">
|
||
|
<$set name="myVariable" tiddler=<<myTiddler>> field={{$:/docs/anyField!!field}}>
|
||
|
<$text text=<<myVariable>>/>
|
||
|
</$set>
|
||
|
</$set>'/>
|