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.
29 lines
679 B
Plaintext
29 lines
679 B
Plaintext
title: CustomWidget-Override-Codeblock
|
|
description: Usage of genesis widget with attributes starting with dollar signs
|
|
type: text/vnd.tiddlywiki-multiple
|
|
tags: [[$:/tags/wiki-test-spec]]
|
|
|
|
title: Output
|
|
|
|
\whitespace trim
|
|
\import Definition
|
|
<$codeblock code="Kangaroo"/>
|
|
<$codeblock code={{Subject}}/>
|
|
<$let test="Tiger">
|
|
<$codeblock code=<<test>>/>
|
|
</$let>
|
|
+
|
|
title: Definition
|
|
|
|
\whitespace trim
|
|
\function <$codeblock>(code)
|
|
<$genesis $type="codeblock" $remappable="no" code={{{ [<code>addprefix[£]addsuffix[@]] }}}/>
|
|
\end
|
|
+
|
|
title: Subject
|
|
|
|
Python
|
|
+
|
|
title: ExpectedResult
|
|
|
|
<p><pre><code>£Kangaroo@</code></pre><pre><code>£Python@</code></pre><pre><code>£Tiger@</code></pre></p> |