mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-07 02:26:19 +00:00
31 lines
1.0 KiB
Plaintext
31 lines
1.0 KiB
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
|
||
|
{{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="[enlist<paramNames>]" counter="counter">
|
||
|
{<$text text={{{ [enlist<paramNames>nth<counter>] }}}/>:<$text text={{{ [enlist<paramValues>nth<counter>] }}}/>}
|
||
|
</$list>
|
||
|
_
|
||
|
title: TiddlerTwo
|
||
|
|
||
|
\whitespace trim
|
||
|
\parameters(zero:'Mouse',one:'Horse',two:'Owl')
|
||
|
(<$transclude $tiddler=<<currentTiddler>> zero=<<zero>> one=<<one>> two=<<two>>/>)
|
||
|
_
|
||
|
title: ExpectedResult
|
||
|
|
||
|
<p>{zero:Jaguar}{one:Lizard}{two:Mole}</p><p>{zero:Ferret}{one:Lizard}{two:Mole}</p><p>{zero:Butterfly}{one:Moth}{two:Mole}</p><p>{zero:Beetle}{one:Scorpion}{two:Snake}</p><p>({zero:Beetle}{one:Scorpion}{two:Snake})</p>
|