What's wrong with this macro?

58 views
Skip to first unread message

Luca Dorigo

unread,
Apr 11, 2018, 4:24:54 AM4/11/18
to TiddlyWiki

I wanted to make a macro to quickly insert a table of contents of all the descendents of a given tiddler.
This is what I wrote:


\define toc-sel()

<div class="tc-table-of-contents">
<<toc-selective-expandable $(currentTiddler)$>>
</div>

\end



However when I use it in a tiddler (<<toc-sel>>), it gives me:


What am I doing wrong?

Auto Generated Inline Image 1

PMario

unread,
Apr 11, 2018, 4:43:59 AM4/11/18
to TiddlyWiki
Hi,

Create a tiddler named: toc-sel


<div class="tc-table-of-contents">
<
<toc-selective-expandable $(currentTiddler)$>>
</div>



Use it with



{{||toc-sel}}



and you are good to go. No macro needed.

Learn more at: https://tiddlywiki.com/#Transclusion:Transclusion%20%5B%5BTransclusion%20with%20Templates%5D%5D

have fun!
mario

Luca Dorigo

unread,
Apr 11, 2018, 5:04:45 AM4/11/18
to TiddlyWiki
Thank you, that works indeed :)

Would you mind explaining what's wrong with my approach?

Mat

unread,
Apr 11, 2018, 11:43:41 AM4/11/18
to TiddlyWiki
Would you mind explaining what's wrong with my approach?
 
Probably you just need quotes around the argument; 

<<toc-selective-expandable "$(currentTiddler)$">>


<:-) 
Reply all
Reply to author
Forward
0 new messages