kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Add classes to the toc macro output
rodzic
2bebde6081
commit
559afcffd9
|
@ -2,7 +2,7 @@ title: $:/core/macros/toc
|
||||||
tags: $:/tags/Macro
|
tags: $:/tags/Macro
|
||||||
|
|
||||||
\define toc(tag,sort:"")
|
\define toc(tag,sort:"")
|
||||||
<ol>
|
<ol class="tc-toc">
|
||||||
<$list filter="[tag[$tag$]$sort$]">
|
<$list filter="[tag[$tag$]$sort$]">
|
||||||
<li>
|
<li>
|
||||||
<$link>
|
<$link>
|
||||||
|
@ -42,7 +42,7 @@ tags: $:/tags/Macro
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define toc-expandable(tag,sort:"")
|
\define toc-expandable(tag,sort:"")
|
||||||
<ol>
|
<ol class="tc-toc toc-expandable">
|
||||||
<$list filter="[tag[$tag$]$sort$]">
|
<$list filter="[tag[$tag$]$sort$]">
|
||||||
<<toc-expandable-body tag:"$tag$" sort:"$sort$">>
|
<<toc-expandable-body tag:"$tag$" sort:"$sort$">>
|
||||||
</$list>
|
</$list>
|
||||||
|
@ -77,7 +77,7 @@ tags: $:/tags/Macro
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define toc-selective-expandable(tag,sort:"")
|
\define toc-selective-expandable(tag,sort:"")
|
||||||
<ol>
|
<ol class="tc-toc toc-selective-expandable">
|
||||||
<$list filter="[tag[$tag$]$sort$]">
|
<$list filter="[tag[$tag$]$sort$]">
|
||||||
<<toc-selective-expandable-body tag:"$tag$" sort:"$sort$">>
|
<<toc-selective-expandable-body tag:"$tag$" sort:"$sort$">>
|
||||||
</$list>
|
</$list>
|
||||||
|
|
|
@ -12,6 +12,8 @@ There are several variants of the macro:
|
||||||
* `<<toc-expandable>>` produces an expandable tree of links
|
* `<<toc-expandable>>` produces an expandable tree of links
|
||||||
* `<<toc-selective-expandable>>` produces an expandable tree of links where the expand/contract buttons are only shown for entries that possess child nodes
|
* `<<toc-selective-expandable>>` produces an expandable tree of links where the expand/contract buttons are only shown for entries that possess child nodes
|
||||||
|
|
||||||
|
The macros all generate HTML ordered lists. The `<ol>` elements are given the class `tc-toc`, with the expandable variant also having the class `tc-toc-expandable` and the selective expandable variant also having the class `tc-toc-selective-expandable`.
|
||||||
|
|
||||||
! Parameters
|
! Parameters
|
||||||
|
|
||||||
|!Position |!Name |!Description |!Default |
|
|!Position |!Name |!Description |!Default |
|
||||||
|
|
Ładowanie…
Reference in New Issue