Folks,

In fact I need not split into lines after extracting sections, just feed it 
into a wikify with html output.

   - In this case I want to keep the prefix and its content, so due to 
   split I have to add the start one back.
   - I am not sure why the "!is[blank] is needed but it is.
   - by default this handles block sections, inline items like span's could 
   be handled as well with mode=inline on the wikify?


Based on your comments I have come up with a working solution I plan to 
generalise further.

<$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>

Source tiddler "NewTiddler"
<section id="example">

;Bank line above 
*WIkitext
*Wikt ''text''
</section>

<section id="example2">

;Bank line above
*WIkitext
*Wikt ''text''
</section>
If the sections are identical (unlike above with a change in ID) you only 
see it once. ie it is de-duplicated (A Good thing)

Now I have a solution to the original thread,* thanks all.* However the 
need to have a real variable feature, I think my example illustrated still 
exists, if not for this case.


Regards
Tony




On Monday, July 27, 2020 at 12:04:21 AM UTC+10, TW Tones wrote:
>
> Folks
>
> 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
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b1b83d99-60fe-43ad-b7df-be62aaedfb21o%40googlegroups.com.

Reply via email to