I am looking at using a custom widget to provide a three line preview of a block of code [TW5] Looking for a way to fold code inside a tiddler - #3 by TW_Tones.
I want to use a custom widget and use the body / ts-raw to contain the “code content” then in my custom widget extract the first three lines for the preview.
The problem is the only way to access the body of the calling widdget inside a custom widget is using <$slot $name="ts-raw"/>
but the problem with this is it is a widget. In some ways a widget is an output mechanism not an input mechanism, that is it is difficult to use the output of a widget as an input to something else, the exception being using wikify to set a variable.
Would it not be possible to access ts-raw as a variable, inside custom widgets?
- This would keep the content of the calling widget in a form further manipulation can be actioned on.
- I do not know how we would handle the depth attribute, perhaps at least ts-raw could be a macro or procedure with a depth attribute, (however one that does not need wikification).
The same would be true for any fill widget as well.