mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-07 10:34:53 +00:00
774459fa73
More details at https://github.com/Jermolene/TiddlyWiki5/pull/6666#issuecomment-1123719153
33 lines
1015 B
Plaintext
33 lines
1015 B
Plaintext
title: Transclude/Parameterised/Name/Values
|
|
description: Parameterised transclusion accessing parameters as name/value pairs
|
|
type: text/vnd.tiddlywiki-multiple
|
|
tags: [[$:/tags/wiki-test-spec]]
|
|
|
|
title: Output
|
|
|
|
\whitespace trim
|
|
<$transclude $tiddler="TiddlerOne" 0="" 1="" 2=""/>
|
|
|
|
{{TiddlerOne}}
|
|
{{TiddlerOne|Ferret}}
|
|
{{TiddlerOne|Butterfly|Moth}}
|
|
{{TiddlerOne|Beetle|Scorpion|Snake}}
|
|
{{TiddlerOne||TiddlerTwo|Beetle|Scorpion|Snake}}
|
|
+
|
|
title: TiddlerOne
|
|
|
|
\whitespace trim
|
|
\parameters(zero:'Jaguar',one:'Lizard',two:'Mole')
|
|
<$list filter="[<@params>jsonindexes[]]">
|
|
{<$text text=<<currentTiddler>>/>: <$text text={{{ [<@params>jsonget<currentTiddler>] }}}/>}
|
|
</$list>
|
|
+
|
|
title: TiddlerTwo
|
|
|
|
\whitespace trim
|
|
\parameters(zero:'Mouse',one:'Horse',two:'Owl')
|
|
(<$transclude $tiddler=<<currentTiddler>> zero=<<zero>> one=<<one>> two=<<two>>/>)
|
|
+
|
|
title: ExpectedResult
|
|
|
|
<p>{0:}{1:}{2:}</p><p></p><p>{0:Ferret}</p><p>{0:Butterfly}{1:Moth}</p><p>{0:Beetle}{1:Scorpion}{2:Snake}</p><p>({one:Scorpion}{two:Snake}{zero:Beetle})</p> |