Ah hah. Got it
Use Case:
1. I want to create footnotes in my document in the form of <<footnote "This is some footnote text">>
e.g.: This is some text <<ref "Text is a collection of letters, spaces and numbers">> And this is a formula: 2+3=5 <<ref "A formula is numbers plus operators">>
should display as: This is some text
1 And this is a formula: 2+3=5
2
with the footnote numbers popping up the text when clicked
2. I want the footnotes to be numbered sequentially when displayed without me having to manually enter the footnote number
3. I want the footnote text to display in a popup when the number is clicked
The problem is with #2, auto-generation of numbers within the text on a page. I don't know of any facility in TiddlyWiki that can do that without some trickiness.
Trickiness options
1. Store the footnote text as entries in a list with the list sorted in the order of their presentation on the page
2. Just manually enter the footnote number as a macro parameter and forget the "automatically" part of request #2
\define footnote(tiddler, text, number)
<$set name="state" value="$:/state/$tiddler$/$number$">
<$button popup=<<state>> class="btn-invisible"
style="border-width:0px">
<$
reveal type="match" text=""
default=""
state=<<state>> >
$number$
</$reveal> <$reveal type="nomatch" text="" default=""
state=<<state>> >
<span
class="footnote">
$text$
</span>
</$reveal>
</$button>
</$set>
\end
\define ref(text, number)
<$macrocall $name="footnote" tiddler=<<currentTiddler>> text="$text$" number="$number$" />
\end
This is some text <<ref "Text is a collection of
letters, spaces and numbers" "1">> And this is a formula: 2+3=5
<<ref "A formula is numbers plus operators" "2">>