The wiki currently lack examples for the wikify widget, thus I suggest we all collaborate to fix that. This wiki will serve as a draft for a future PR to the doc. Please feel free to edit it!
Using the output of widgets in a filter expression
<$let
target="purple"
colourA="white"
colourB="black"
>
<$wikify name="wikified-color" text="""
<$macrocall $name="contrastcolour"
target=<<target>>
fallbackTarget=<<fallbackTarget>>
colourA=<<colourA>>
colourB=<<colourB>>
/>""">
<span style={{{"color:"=[<wikified-color>]";background:"=[<target>]+[join[]] }}}>Text with good contrast</span>
</$wikify>
</$let>
Accurate word count calculation
If a tiddler transclude some content, or use widgets to generate content, filters that try to calculate the word count won’t be accurate - we need to analyses the text AFTER it’s wikified.
Example:
\define lorem() lorem ipsum dolor
<$list filter="[range[0],[10]]"><<lorem>></$list>
Rendered output:
lorem ipsum dolorlorem ipsum dolorlorem ipsum dolorlorem ipsum dolorlorem ipsum dolorlorem ipsum dolorlorem ipsum dolorlorem ipsum dolorlorem ipsum dolorlorem ipsum dolorlorem ipsum dolor
- Word count without wikify =
{{{ [<code>split[ ]count[]] }}}
= 6 - Word count with wikify =
{{{ [<wikify-output>split[ ]count[]] }}}
= 23
Exporting rendered html out of tiddlywiki
<$edit-text field="code" tag="textarea" class="tc-edit-texteditor" placeholder="Write some wikitext.."/>
Copy rendered html:
<$wikify name="code" text={{!!code}} output="html">
<$codeblock code=<<code>>/>
<$macrocall $name="copy-to-clipboard" src=<<code>>/>
</$wikify>