Update

For anyone interested I have now generalise this to create a macro for 
extracting any hard coded html tags/sections from a tiddler. 

Uses
   
   - Allows you to divide tiddlers into sections using html, and access 
   such sections from elsewhere
      - Not unlike transcluding a fragment of a tiddlywiki
   
Examples
   
   - Create an excerpt or abstract section in your tiddler and include only 
   that in a separate list
   - Extract html tables from tiddlers to display and link to in an appendix
   - many more

I know realise it would only be a small step to extract content by HTML tag 
after rendering the content of a tiddler into html. 
This would allow any html tag which is the result of tiddlywikis render 
process also to be extracted and displayed, 

An example would be the use of tiddlywikis "|" table encoding method, since 
this is translated to html table tag during rendering you could extract 
table made this way OR HTML hard coded tables from any tiddler.

*Further speculation*

   - One could write tiddlers with wiki text and macros generating a 
   required result, then access this from any other tiddler as finalised html 
   or even more precisely extract value(s) from that result, ie we can pull 
   content and reuse it without demanding additional wiki text and rendering. 
   In a way this would be like screen scraping ones own site.
   - What if we could do this to the contents on an iframe or other content 
   include method? Integration would be very easy.

Regards
TW Tones
Always wanting to extend the possibilities of Tiddlywiki


On Sunday, July 26, 2020 at 11:34:11 AM UTC+10, TW Tones wrote:
>
> Folks,
>
> The following objective I believe exposes a limitation in tiddlywiki I 
> would like to resolve; however I wish to find at least a work around for 
> now.
>
> I am just writing a macro to process lines in a tiddler
> <$tiddler tiddler=<<tiddlername>> >
> <$list filter="[all[current]get[text]splitregexp[\n]]" variable=line>
>
> </$list>
> </$tiddler> 
>
> However inside the list, I want to process each line, 
>
>    - However I wish to detect a start and end condition and display only 
>    the lines including and between the start and end condition.
>    - This start and end condition may occur more than once in the same 
>    tiddler.
>    - A real world example may be extracting the content between an open 
>    and close html div or section tag.
>
> To do this my first idea so far is 
>
>    - setting a flag at the start of when the condition is met, 
>    - displaying each line when this flag is on
>    - and turning the flag off when the end condition is met.
>
> However this flag would be a variable in the traditional (non tiddlywiki 
> sense) and I do not believe we have one in, tiddlywiki that does not 
> require a trigger to set a text reference to that value. This is a gap I 
> have recognised for some time but had trouble communicating.
>
> A second idea is to "call a sub-routine", while the condition is met, 
>
>    - but to do this we need to have the ability to request the next line 
>    from the source tiddler
>    - We can not do this to my knowledge because the flow must return to 
>    the next item in the list that calls the subroutine.
>
>
> Can anyone share a solution to this issues please?
>
> thanks in advance for considering this
> TW Tones
>
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b816344b-9350-46e3-b386-649bcb4b7b11o%40googlegroups.com.

Reply via email to