I'm trying to generate description for a tiddler automatically.
I have learned wikify widget, which can turn tiddler source code into plain text without html tags.
<$wikify name="rendered" text={{tiddler-title!!text}} output="text">
<<rendered>>
</$wikify>
I've also learned filter widget, which can split plain text by some special characters.
<$list filter="'abc/def'+[split[/]first[]]">
<<currentTiddler>>
</$list>
But I don't know if there is a way to pipe the two operation together for description generating?
Hi @pimgeek
I have learned wikify widget, which can turn tiddler source code into plain text without html tags.
There's a couple of much simpler (and faster) way to achieve the same thing:
<$view tiddler="tiddler-title" field="text"/>
<$text text={{tiddler-title!!text}}/>
But I don't know if there is a way to pipe the two operation together for description generating?
The trick is using triple curly braces for attribute values. The content of the braces is interpreted as a filter (see https://tiddlywiki.com/#Filters), and the first entry from the resulting list is assigned to the attribute (see "Filtered Attribute Values" under https://tiddlywiki.com/#HTML%20in%20WikiText). Thus, you could do something like this:
<$text text={{{ [[tiddler-title]get[text]split[/]] }}}/>
Thanks very much for your reply, almost instantly~~
Now I know how to achieve my desired results! Even if my tiddler source has a lot of wiki codes, I can first use $wikify widget to turn it into plain text, and then use the method offered by you. I really should have asked you earlier.
[img width="160px" [....jpg]]
<a href="https://tiddlywiki.com" rel="noopener noreferrer">
[img[....png]]
</a>
This is a knowledge base built on [[TiddlyWiki]] . First time visitor please goto ...
This is a knowledge base built on TiddlyWiki
<$wikify name="rendered" text={{about!!text}} output="text">
<$text text={{{ [<rendered>split[. ]] }}}/>
</$wikify>
Most helpful comment
Hi @pimgeek
There's a couple of much simpler (and faster) way to achieve the same thing:
The trick is using triple curly braces for attribute values. The content of the braces is interpreted as a filter (see https://tiddlywiki.com/#Filters), and the first entry from the resulting list is assigned to the attribute (see "Filtered Attribute Values" under https://tiddlywiki.com/#HTML%20in%20WikiText). Thus, you could do something like this: