There are multiple ways to interpret your request. Here's one:

\define toc-body(tag,sort:"",itemClassFilter,exclude,path)
  <$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] 
-[[$tag$]] $exclude$""">
    <$vars item=<<currentTiddler>> path="""$path$/$tag$""" 
excluded="""$exclude$ 
-[[$tag$]]""">
      <$set name="toc-item-class" filter="""$itemClassFilter$""" emptyValue=
"toc-item" value="toc-item-selected">
          <$list filter="[all[current]toc-link[no]]" emptyMessage="<h1><$view 
field='title'></h1><$transclude mode='block'/>">
<h1><$view field="title"/></h1>            
<$transclude mode='block'/>
          </$list>
          <$macrocall $name="toc-body" tag=<<item>> sort="""$sort$""" 
itemClassFilter="""$itemClassFilter$""" exclude=<<excluded>> path=<<path>>/>
      </$set>
    </$vars>
  </$list>
\end

Put the macro definition at the top of your tiddler followed by your toc 
macro invocation, and it will give a "flattened" (no indents) version of 
the TOC with each title presented as an H1 header. This will number the 
header's using C Pa's stylesheet.

Be sure to make backups before trying this in case there are recursion 
errors.

HTH
-- Mark

On Thursday, July 12, 2018 at 3:07:19 AM UTC-7, Andrej Korenić wrote:
>
> I finally found that TW5 has really neat way of handling ToC entries 
> <https://tiddlywiki.com/#Table-of-Contents%20Macros>, and I search macros 
> and discussion topics to find whether it would be possible to transclude 
> all of those tiddlers into one single tiddler? 
>
> Basically I am just using:
>
> <div class="tc-table-of-contents">
> <<toc "Contents" sort[title]>>
> </div>
>
> and nested tags as example suggests.
>
> I used the code from the topic about numbered headings 
> <https://groups.google.com/forum/#!topic/tiddlywiki/1bnaQU3O3j0> in TW5:
>
> <div class="nr">
>
> {{H 1}}
>
> {{H 1-1}}
>
> </div>
>
> so I can get the heading numbers if I transclude tiddlers one by one (by 
> using their title and showing caption in ToC), however I cannot find how to 
> automatize that process.
>
> Many thanx
>

-- 
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/61c00f68-e260-458b-b846-ee314ab514b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to