I plan to soon add a filter option to my TOC generic plugin 
<https://groups.google.com/forum/#!topic/TiddlyWiki/KZWhS-BtZCQ>.


onsdag den 29. januar 2020 kl. 00.34.35 UTC+1 skrev TonyM:
>
> Folks,
>
> I have another approach, test this on TiddlyWiki.com
>
> Create a tiddler containing this and tag with $:/tags/ViewTemplate
> \define default-toc-here()
>    <h4>Optional TOC here</h4>
> <$list filter="[tag<currentTiddler>limit[1]]" emptyMessage="//nothing 
> tagged with <<currentTiddler>>//" variable=nul >
>    <$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> >
> </$list>
> \end
> <$list filter="[all[current]has:field[toc-here]]" variable=nul>
>     <$list filter="[all[current]get[toc-here]]" variable=toc-tiddler 
> emptyMessage=<<default-toc-here>> >
>              <h4>Optional TOC <<toc-tiddler>></h4>
>              <$macrocall $name="toc-selective-expandable" tag=<<toc-
> tiddler>> >
>     </$list>
> </$list>
>
>
>    - Nothing will happen right away.
>    - Now add the field toc-here to any tiddler and it will provide a toc 
>    based on the current tiddler. Use new here to add items to its toc
>    - If however you give that field a value of tiddlername eg HelloThere 
>    <https://tiddlywiki.com/#HelloThere> then the tiddlername will be used 
>    as the root of the TOC
>
> Advantages of this approach
>
>    - No additional tag use
>    - Ability to reference other parts of a TOC
>
>
This is a cool. I will see how to put that in the TOC generic plugin. 
<https://groups.google.com/forum/#!topic/TiddlyWiki/KZWhS-BtZCQ>
<https://groups.google.com/forum/#!topic/TiddlyWiki/KZWhS-BtZCQ>

>
> I can see some useful enhancements, but do consider my approach as a "Code 
> Pattern"
>

what does Code Pattern meaon? 

>
>

-- 
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/c31c55f4-ee22-4518-901b-32bee6ec34a8%40googlegroups.com.

Reply via email to