[tw5] Re: Table of Contents behavior

2021-01-13 Thread Stefan Schlechter
Yes - that's it!
Thanks to Mario and Chris

Greetings,
Stefan
clutterstack schrieb am Mittwoch, 13. Jänner 2021 um 16:38:44 UTC+1:

> D'oh! I'd say there's no shame in being out-TWed by Mario, but this is 
> actually demonstrated in the tiddlywiki.com tiddler "Example Table of 
> Contents: Selectively Expandable", where the tiddler "SecondThree" has the 
> toc-link: 
> no field and works great. So mea culpa for assuming how the rest of the 
> macro would handle things. Sorry, Stefan. Sorry, Mario!
>
> Best,
> Chris
>
> On Wednesday, January 13, 2021 at 5:55:56 AM UTC-5 PMario wrote:
>
>> Hi,
>> Have a closer look here: 
>> https://tiddlywiki.com/#Table-of-Contents%20Macros
>> Search for the field: toc-link: no parameter
>> IMO there is no need to change the macro code.
>> -m
>>
>> On Tuesday, January 12, 2021 at 8:49:24 AM UTC+1 schlechter...@gmail.com 
>> wrote:
>>
>>> Hello,
>>>
>>> I would like to expand the next level of entries by clicking on title in 
>>> TOC ( as it is by clicking on '>') instead of opening the tiddler.
>>>
>>> [image: TOC behavior.jpg]
>>>
>>> How can I archieve that?
>>>
>>> Thanks
>>> Stefan
>>>
>>

-- 
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/d0f8bd93-7030-4d39-af68-9b7c2bee564cn%40googlegroups.com.


[tw5] Re: Table of Contents behavior

2021-01-13 Thread clutterstack
D'oh! I'd say there's no shame in being out-TWed by Mario, but this is 
actually demonstrated in the tiddlywiki.com tiddler "Example Table of 
Contents: Selectively Expandable", where the tiddler "SecondThree" has the 
toc-link: 
no field and works great. So mea culpa for assuming how the rest of the 
macro would handle things. Sorry, Stefan. Sorry, Mario!

Best,
Chris

On Wednesday, January 13, 2021 at 5:55:56 AM UTC-5 PMario wrote:

> Hi,
> Have a closer look here: 
> https://tiddlywiki.com/#Table-of-Contents%20Macros
> Search for the field: toc-link: no parameter
> IMO there is no need to change the macro code.
> -m
>
> On Tuesday, January 12, 2021 at 8:49:24 AM UTC+1 schlechter...@gmail.com 
> wrote:
>
>> Hello,
>>
>> I would like to expand the next level of entries by clicking on title in 
>> TOC ( as it is by clicking on '>') instead of opening the tiddler.
>>
>> [image: TOC behavior.jpg]
>>
>> How can I archieve that?
>>
>> Thanks
>> Stefan
>>
>

-- 
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/2185417b-0b10-4ea7-bd2d-074f8dec63f7n%40googlegroups.com.


[tw5] Re: Table of Contents behavior

2021-01-13 Thread PMario
Hi,
Have a closer look here: https://tiddlywiki.com/#Table-of-Contents%20Macros
Search for the field: toc-link: no parameter
IMO there is no need to change the macro code.
-m

On Tuesday, January 12, 2021 at 8:49:24 AM UTC+1 schlechter...@gmail.com 
wrote:

> Hello,
>
> I would like to expand the next level of entries by clicking on title in 
> TOC ( as it is by clicking on '>') instead of opening the tiddler.
>
> [image: TOC behavior.jpg]
>
> How can I archieve that?
>
> Thanks
> Stefan
>

-- 
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/c4dae1a2-3083-4458-bd6a-f61055f307e8n%40googlegroups.com.


[tw5] Re: Table of Contents behavior

2021-01-12 Thread Stefan Schlechter
Hi Chris,

thanks for feedback.

I've implemented your mentioned changesabove  -> that will remove all links 
- also from the last level of TOC 'Story 1, Story 2 etc.'

How can this be done:
3) display the tiddler's caption/title by itself for tiddlers that have 
nothing below them in the ToC hierarchy. (If you wanted, you could make 
just these captions tiddler links) 

Thanks
Stefan
clutterstack schrieb am Dienstag, 12. Jänner 2021 um 22:55:47 UTC+1:

> Hi Stefan,
>
> It looks like you'd like to modify the behaviour of the 
> toc-selective-expandable macro. The necessary changes for this particular 
> case would be contained within the toc-linked-selective-expandable-body 
> macro. Both are defined in $:/core/macros/toc.
>
> You'd need to redefine (override) toc-linked-selective-expandable-body to:
>
> 1) remove the tiddler link
> 2) display the tiddler's caption/title within the fold/unfold button, for 
> tiddlers that have more tiddlers downstream in the ToC, and 
> 3) display the tiddler's caption/title by itself for tiddlers that have 
> nothing below them in the ToC hierarchy. (If you wanted, you could make 
> just these captions tiddler links)
>
> I suggest making a new macro tiddler (tag it with $:/tags/Macro) with 
> something like the following in it. I've highlighted (I think) all the 
> changes I made. Obviously anything that's commented out could just be 
> removed.
>
> \define 
> toc-linked-selective-expandable-body(tag,sort:"",itemClassFilter,exclude,path)
> <$qualify name="toc-state" title={{{ 
> [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix] 
> }}}>
>   <$set name="toc-item-class" filter=<<__itemClassFilter__>> 
> emptyValue="toc-item-selected" value="toc-item" >
> >>
>   
>   <$list filter="[all[current]tagging[]$sort$limit[1]]" 
> variable="ignore" emptyMessage="<$button 
> class='tc-btn-invisible'>{{$:/core/images/blank}} <>
> ">
>   <$reveal type="nomatch" stateTitle=<> text="open">
> <$button setTitle=<> setTo="open" 
> class="tc-btn-invisible tc-popup-keep">
>   {{$:/core/images/right-arrow}}<>
> 
>   
>   <$reveal type="match" stateTitle=<> text="open">
> <$button setTitle=<> setTo="close" 
> class="tc-btn-invisible tc-popup-keep">
>   {{$:/core/images/down-arrow}}<>
> 
>   
> 
>
>   
>   <$reveal type="match" stateTitle=<> text="open">
> <$macrocall $name="toc-selective-expandable" 
> tag=<> sort=<<__sort__>> 
> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>> 
> path=<<__path__>>/>
>   
> 
>   
> 
> \end
>
> The definition of toc-caption can be found at the top of 
> $:/core/macros/toc.
>
> Hope that helps,
> Chris
> On Tuesday, January 12, 2021 at 2:49:24 AM UTC-5 schlechter...@gmail.com 
> wrote:
>
>> Hello,
>>
>> I would like to expand the next level of entries by clicking on title in 
>> TOC ( as it is by clicking on '>') instead of opening the tiddler.
>>
>> [image: TOC behavior.jpg]
>>
>> How can I archieve that?
>>
>> Thanks
>> Stefan
>>
>

-- 
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/27a82869-d913-4129-ba0a-235d5675139dn%40googlegroups.com.


[tw5] Re: Table of Contents behavior

2021-01-12 Thread clutterstack
Hi Stefan,

It looks like you'd like to modify the behaviour of the 
toc-selective-expandable macro. The necessary changes for this particular 
case would be contained within the toc-linked-selective-expandable-body 
macro. Both are defined in $:/core/macros/toc.

You'd need to redefine (override) toc-linked-selective-expandable-body to:

1) remove the tiddler link
2) display the tiddler's caption/title within the fold/unfold button, for 
tiddlers that have more tiddlers downstream in the ToC, and 
3) display the tiddler's caption/title by itself for tiddlers that have 
nothing below them in the ToC hierarchy. (If you wanted, you could make 
just these captions tiddler links)

I suggest making a new macro tiddler (tag it with $:/tags/Macro) with 
something like the following in it. I've highlighted (I think) all the 
changes I made. Obviously anything that's commented out could just be 
removed.

\define 
toc-linked-selective-expandable-body(tag,sort:"",itemClassFilter,exclude,path)
<$qualify name="toc-state" title={{{ 
[[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix] 
}}}>
  <$set name="toc-item-class" filter=<<__itemClassFilter__>> 
emptyValue="toc-item-selected" value="toc-item" >
>>
  
  <$list filter="[all[current]tagging[]$sort$limit[1]]" 
variable="ignore" emptyMessage="<$button 
class='tc-btn-invisible'>{{$:/core/images/blank}} <>
">
  <$reveal type="nomatch" stateTitle=<> text="open">
<$button setTitle=<> setTo="open" 
class="tc-btn-invisible tc-popup-keep">
  {{$:/core/images/right-arrow}}<>

  
  <$reveal type="match" stateTitle=<> text="open">
<$button setTitle=<> setTo="close" 
class="tc-btn-invisible tc-popup-keep">
  {{$:/core/images/down-arrow}}<>

  

   
  
  <$reveal type="match" stateTitle=<> text="open">
<$macrocall $name="toc-selective-expandable" tag=<> 
sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> 
exclude=<<__exclude__>> path=<<__path__>>/>
  

  

\end

The definition of toc-caption can be found at the top of $:/core/macros/toc.

Hope that helps,
Chris
On Tuesday, January 12, 2021 at 2:49:24 AM UTC-5 schlechter...@gmail.com 
wrote:

> Hello,
>
> I would like to expand the next level of entries by clicking on title in 
> TOC ( as it is by clicking on '>') instead of opening the tiddler.
>
> [image: TOC behavior.jpg]
>
> How can I archieve that?
>
> Thanks
> Stefan
>

-- 
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/d44023fa-3491-4d82-b448-47086900443en%40googlegroups.com.