<$tiddler tiddler=<<tiddlername>> >
<$list filter="[all[current]get[text]splitregexp[\n]]" variable=line>
</$list>
</$tiddler>
[all[current]search:text:regexp[^start]get[text]splitregexp[\n]regexp[^start]" variable=line
[<line>splitbefore<endcondition>]
[{Tiddler 1}split[<p>]splitbefore[</p>]removesuffix[</p>]!is[blank]]
I suspect the answer is close, and within what you have suggested so far but it is because we do not have access to real variables. I am experienced in procedural languages. I know how to do this in other languages almost with my eyes closed.
Just to explain this a little further an example is wrapping a section in the html section tag, ideally allowing me to extract one or more sections in a tiddler.
In this case I would like to keep the section open and close in my output so I may access other attributes on the section such as style, class or id. In a way I want to be able to transclude a whole section, or more from one tiddler in another tiddler
In a procedural language I would process a line at a time using splitregexp. When I find the start set a flag which will output the lines until the end conditions is true, when I clear the flag. Subsequent lines are ignored until the end or the start condition is triggered.
Its such simple logic.
If we could define a value then access and update it on the fly this would be easy. Unfortunatly in tiddlywiki set and vars are more like declarations. Even widgets tend to act on their contents and we do not have independent variables.
You can set a text reference to a value, retrieve and increment and save it however you must have a button to trigger it.
This needs forcing into tiddlywiki.
Regards
Tony
<$list filter="[{NewTiddler}split[<section]splitbefore[</section>]!is[blank]addprefix[<section ]]" variable=section>
<$wikify name=display-section text="<<section>>" output=html>
<<display-section>>
</$wikify>
</$list>
<section id="example">
;Bank line above
*WIkitext
*Wikt ''text''
</section>
<section id="example2">
;Bank line above
*WIkitext
*Wikt ''text''
</section>