Howdy again,

I have tried for a couple of hours today to solve this problem (in my last 
post), but I just can't figure it out even with the Inspect feature of 
Chrome. It's probably very simple, but I'm not seeing it. 

Thanks,

Damon


On Thursday, June 6, 2019 at 10:04:44 AM UTC-5, Damon Pritchett wrote:
>
> Have had some fun this morning working with Mark's idea. I modified the 
> code somewhat to add the current Tiddler to the diagram. Here's the code:
>
> \define toc-body2(tag,sort:"",itemClassFilter,exclude,path)
> <ul class="list-tree">
>   <li> <<currentTiddler>> </li>
>   <ul class="list-tree">
>     <$list 
> filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] 
> -[<__tag__>] -[enlist<__exclude__>]""">
>       <$vars item=<<currentTiddler>> path={{{ 
> [<__path__>addsuffix[/]addsuffix<__tag__>] }}} 
> excluded="""[enlist<__exclude__>] -[<__tag__>]""">
>          <$set name="toc-item-class" filter=<<__itemClassFilter__>> 
> emptyValue="toc-item" value="toc-item-selected">
>           <li class="list-tree">
>             <$list filter="[all[current]toc-link[no]]" 
> emptyMessage="<$link><$view field='caption'><$view field='title'/></$view
> ></$link>">
>               <<toc-caption>>
>             </$list>
>             <$macrocall $name="toc-body" tag=<<item>> sort=<<__sort__>> 
> itemClassFilter=<<__itemClassFilter__>> exclude=<<excluded>> path=<<path>>/>
>           </li>
>         </$set>
>       </$vars>
>     </$list>
>   </ul>
> </ul>
> \end
>
>
> \define toc2(tag,sort:"",itemClassFilter:"list-tree")
> <$macrocall $name="toc-body2"  tag=<<__tag__>> sort=<<__sort__>> 
> itemClassFilter=<<__itemClassFilter__>> />
> \end
>
> This is quite close. However, as you can see in the picture below, it's 
> not quite right. The top diagram is from the macro and the bottom is just a 
> list with list-tree. There's something about the table of contents macro 
> that is changing things slightly. I've messed around with stylesheets, but 
> haven't quite found the key area to tweak without changing the look of the 
> 2nd diagram. I tried tweaking the macro in the class areas, but to no 
> avail. Any thoughts?
>
> [image: Picture.png]
>
>
>
>
>
>
> On Wednesday, June 5, 2019 at 7:16:13 PM UTC-5, Mark S. wrote:
>>
>> To call the TOC with the title of the current tiddler, use:
>>
>> <$macrocall $name="toc2" tag=<<currentTiddler>>/>
>>
>> Note that I'm using "toc2". This is the macro you will need to create to 
>> get your lines. Install the line-tree plugin if you haven't already. 
>> Then create a new tiddler and tag it $:/tags/Macro. Put in the following 
>> contents:
>>
>> \define toc-body2(tag,sort:"",itemClassFilter,exclude,path)
>> <ul class="list-tree">
>>   <$list filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] 
>> -[<__tag__>] -[enlist<__exclude__>]""">
>>     <$vars item=<<currentTiddler>> path={{{ 
>> [<__path__>addsuffix[/]addsuffix<__tag__>] 
>> }}} excluded="""[enlist<__exclude__>] -[<__tag__>]""">
>>       <$set name="toc-item-class" filter=<<__itemClassFilter__>> 
>> emptyValue="toc-item" value="toc-item-selected">
>>         <li class="xlist-tree">
>>           <$list filter="[all[current]toc-link[no]]" 
>> emptyMessage="<$link><$view field='caption'><$view field='title'/></$view
>> ></$link>">
>>             <<toc-caption>>
>>           </$list>
>>           <$macrocall $name="toc-body" tag=<<item>> sort=<<__sort__>> 
>> itemClassFilter=<<__itemClassFilter__>> exclude=<<excluded>> path=<<path>>/>
>>         </li>
>>       </$set>
>>     </$vars>
>>   </$list>
>> </ul>
>> \end
>>
>> \define toc2(tag,sort:"",itemClassFilter:" ")
>> <$macrocall $name="toc-body2"  tag=<<__tag__>> sort=<<__sort__>> 
>> itemClassFilter=<<__itemClassFilter__>> />
>> \end
>>
>>
>> This worked in my quick tests.
>>
>> Be sure to have backups before you do any of this, of course.
>>
>> Good luck
>>
>>
>>
>> On Wednesday, June 5, 2019 at 4:42:28 PM UTC-7, Damon Pritchett wrote:
>>>
>>> Hey Tony,
>>>
>>> Yes, that works in a sense, but I would like the output to look like 
>>> what the ListTree plugin output looks like. Also, I'm not sure how to call 
>>> the ToC macro with the title of the current tiddler.
>>>
>>> This image is kind of what I'm looking for with the possibility of it 
>>> being expandable.
>>>
>>> [image: Capture.PNG]
>>>
>>>
>>> On Wednesday, June 5, 2019 at 6:13:18 PM UTC-5, TonyM wrote:
>>>>
>>>> Damon,
>>>>
>>>> Surely this will do it?
>>>>
>>>> [[Top Tiddler]]
>>>>
>>>> <div class="tc-table-of-contents">
>>>> <<toc "Top Tiddler">>
>>>> </div>
>>>>
>>>>
>>>> But then I do not yet use tidgraph
>>>>
>>>> Regards
>>>> Tony
>>>>
>>>> On Thursday, June 6, 2019 at 1:50:37 AM UTC+10, Damon Pritchett wrote:
>>>>>
>>>>> Hi Mark S.,
>>>>>
>>>>> Thanks for the reply. That's not exactly what I'm looking for because 
>>>>> then I would have to create many, many extraneous "Master" tiddlers and 
>>>>> that would clutter things up considerably in my view although that would 
>>>>> do 
>>>>> what I'd like as you say. I'd like this to be generic in that I'm 
>>>>> considering putting this in a tiddler tagged ViewTemplate.
>>>>>
>>>>> Damon
>>>>>
>>>>>
>>>>> On Wednesday, June 5, 2019 at 10:40:04 AM UTC-5, Mark S. wrote:
>>>>>>
>>>>>> About including the root in the tree. Can't you just make a tiddler 
>>>>>> one level above what you want to start at?
>>>>>>
>>>>>> So, for instance, in the TOC examples, you could make a "Master" 
>>>>>> tiddler. You could tag the "Contents" macro with "Master", and then 
>>>>>> start 
>>>>>> the tree with the tag "Master". Now "Contents" is included in the tree. 
>>>>>> Or 
>>>>>> ... maybe you meant something else ?
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wednesday, June 5, 2019 at 8:17:14 AM UTC-7, Damon Pritchett wrote:
>>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I would like to create a hierarchical tag tree similar to a table of 
>>>>>>> contents that also includes the root in the list. I would also like to 
>>>>>>> style it in the manner of list-tree (http://listtree.tiddlyspot.com/).. 
>>>>>>> I'm using tags to show relationships of company changes of name and 
>>>>>>> mergers 
>>>>>>> (company succession). The ToC macros work great, but they don't include 
>>>>>>> the 
>>>>>>> root tiddler and I really like the list-tree format. I don't fell that 
>>>>>>> my 
>>>>>>> knowledge is good enough yet to figure out how to modify them on my 
>>>>>>> one. In 
>>>>>>> addition, I want to have the root as the current tiddler.
>>>>>>>
>>>>>>> Thanks very much in advance.
>>>>>>>
>>>>>>> Damon
>>>>>>>
>>>>>>

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/7446b86e-24da-41ec-aa58-401e87cf7a5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to