OcttKB/Wiki/tiddlers/$__Macros_Footnotes.tid

40 lines
1.0 KiB
Plaintext

created: 20230215225211565
creator: Octt
modified: 20230215230528887
modifier: Octt
tags: $:/tags/Macro
title: $:/Macros/Footnotes
<!--
Note: The most of the code in this macro (DetailsFootnotes) is copied from [[$:/plugins/kookma/refnotes/macros/showfnotes]]
-->
\define DetailsFootnotes(filter:"[<currentTiddler>]", title:"Empty" class:"fnote-list DetailsFootnotes", emptyMessage:"")
<$vars leftDelimiter="<<fnote ">
<$list filter="[subfilter<__filter__>search:text:literal<leftDelimiter>limit[1]]" variable=null emptyMessage=<<__emptyMessage__>> ><!-- check to see if there is any footnote -->
<details class="tw-details">
<summary>
<$reveal tag="div" type="nomatch" default="Empty" text=<<__title__>> >
<span>$title$</span>
</$reveal>
</summary>
<ol class="$class$">
<$list filter=<<__filter__>> >
<$macrocall $name="find"
text={{!!text}}
begin="<<fnote "
end=">>"
output="output-fnote"
/>
</$list>
</ol>
</details>
</$list>
</$vars>
\end
\define output-fnote(p)
<$vars output=$p$>
<li><<output>></li>
</$vars>
\end