Hey coding folks :)
I have put the well-known TOC-Macrocall
<<toc-selective-expandable 'TOC'>>
into another WikiText Macro
\define toctoc()
"""
<div class="tc-table-of-contents">
<$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>>/>
</div>
"""
\end
and then put the call for that one in a tiddler and just calling
then.
I have done this, because
- I found it was two much code, especially with the div formatting around, if you use it again and again for many different tiddlers
- I don't wanted to write the titel of the tiddler manually, every time
- In the future I want changes to be simple, so I can just change my macro and not every tiddler
So this macro is working fine in the tiddler! But! The TOC
doesn't show up, when I view the tiddler
in the Sidebar by tagging it with
$:/tags/SideBar - but the rest of normal Text inside the tiddler shows up there.
So, what is wrong? I tested, and when I replace the
<<currentTiddler>>
Variable for the tag with an
actual tag like 'Chapter 12'
it is working fine in the Sidebar!
I also tried it in the form of
\define toctoc()
<div class="tc-table-of-contents">
<<toc-selective-expandable """$(currentTiddler)$""">>
</div>
\end
with no results as well.
So again, the
problem seems to be the CurrentTiddler Variable, in clear Text (what makes no sense for a macro) it is working well in the Sidebar.
How can I make it work in the Sidebar with the CurrentTiddler Variable?
Thanks for attention :)