mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-07 02:26:19 +00:00
f307f00e32
There are two big changes here: Replace the previous "ts-wrapper" mechanism, which we had been using to redefine custom widgets inside their definitions to prevent recursive calls. Now we've got the genesis widget we can instead control recursion through a new "$remappable" attribute that allows the custom widget mechanism to be skipped. We also extend the slot widget to allow a depth to be specified; it then reaches up by the indicated number of transclusion widgets to find the one from which it should retrieve the slot value.
31 lines
674 B
Plaintext
31 lines
674 B
Plaintext
title: Transclude/CustomWidget/TextWidgetOverride
|
|
description: Custom widget definition redefining the text widget
|
|
type: text/vnd.tiddlywiki-multiple
|
|
tags: [[$:/tags/wiki-test-spec]]
|
|
|
|
title: Output
|
|
|
|
\whitespace trim
|
|
<$transclude $tiddler='TiddlerOne'>
|
|
</$transclude>
|
|
+
|
|
title: TiddlerOne
|
|
|
|
\whitespace trim
|
|
<!-- Redefine the <$text> widget by defining a transcludable variable with that name -->
|
|
\function <$text>(text:'Jaguar')
|
|
\whitespace trim
|
|
<$genesis $type="text" $remappable="no" text=<<text>>/>
|
|
<$set name="<$text>" value="">
|
|
<$slot $name="ts-body">
|
|
Whale
|
|
</$slot>
|
|
</$set>
|
|
\end
|
|
<$text text="Dingo">
|
|
Crocodile
|
|
</$text>
|
|
+
|
|
title: ExpectedResult
|
|
|
|
<p>DingoCrocodile</p> |