mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-05-02 03:46:46 +00:00
Provide examples for the wikify widget (#8792)
* Provide examples for the wikify widget * fix a typo in the wikify widget doc tiddler * Update and rename TestCases_WikifyWidget_WidgetInput_Fail.tid to TestCases_WikifyWidget_WidgetValue_Fail.tid * Update and rename TestCases_WikifyWidget_WidgetInput_Success.tid to TestCases_WikifyWidget_WidgetValue_Success.tid * Update WikifyWidget.tid * Update TestCases_WikifyWidget_WidgetValue_Fail.tid * Update TestCases_WikifyWidget_WidgetValue_Success.tid * Update WikifyWidget.tid * Update TestCases_WikifyWidget_WidgetValue_Success.tid fix small error causing validation to fail * Update TestCases_WikifyWidget_WidgetValue_Success.tid * remove trailing end line * remove trailing new line * add description, remove modified field
This commit is contained in:
committed by
GitHub
parent
c7b45a3eb0
commit
106fe2dfb9
@@ -0,0 +1,43 @@
|
||||
created: 20241202003148804
|
||||
description: Using a widget as a value
|
||||
tags: $:/tags/wiki-test-spec
|
||||
title: TestCases/WikifyWidget/WidgetValue/Success
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
|
||||
title: Narrative
|
||||
|
||||
If you use <<.wid wikify>>, you can get the rendered output and use it as a value.
|
||||
+
|
||||
title: Output
|
||||
|
||||
<$wikify name="wikified-color" text={{widget}} >
|
||||
<span style.color=<<wikified-color>> style.background={{target}}>
|
||||
{{widget}} text on {{target}} is a good contrast
|
||||
</span>
|
||||
</$wikify>
|
||||
+
|
||||
title: widget
|
||||
|
||||
<$transclude $variable="contrastcolour"
|
||||
target={{target}}
|
||||
fallbackTarget=<<fallbackTarget>>
|
||||
colourA={{colourA}}
|
||||
colourB={{colourB}}
|
||||
/>
|
||||
+
|
||||
title: target
|
||||
text: purple
|
||||
+
|
||||
title: colourA
|
||||
text: white
|
||||
+
|
||||
title: colourB
|
||||
text: black
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>
|
||||
<span style="color:white;background:purple;">
|
||||
white text on purple is a good contrast
|
||||
</span>
|
||||
</p>
|
||||
Reference in New Issue
Block a user