Mohammed: change request to <<fnote>> macro

130 views
Skip to first unread message

Chuck R.

unread,
Jan 16, 2020, 1:00:39 PM1/16/20
to TiddlyWiki
Mohammed,
For TW5 I think you wrote the <<fnote>> macro which is part of a plugin here: https://kookma.github.io/Refnotes/

Currently the <<fnote>> macro takes 1 parameter in a variety of formats. The change I'm asking for is adding a second parameter to be the page number of the footnote I'm referencing. For example I might have in a "Footnotes" tiddler a reference called "mypdf" which points to an url http://www.somewhere.com/mypdf.pdf. But I might reference this PDF and use a different page for each different reference I call out.

So the new way to call out the fnote macro would be: <<fnote {{Footnotes##mypdf}} 16>>
where 16 is the page in the PDF I'm referencing. So when the mouse hovers over the footnote superscript number, the footnote might display "http://www.somewhere.com/mypdf.pdf, pg16"

Another format would be <<fnote {{Footnotes##mypdf}} "16-18">> which would reference pages 16-18 and would be displayed as
"http://www.somewhere.com/mypdf.pdf, pp16-18"

Does that make sense?

Chuck R.

unread,
Jan 16, 2020, 1:01:23 PM1/16/20
to TiddlyWiki
Sorry, I don't know how to ping you here.

Mohammad

unread,
Jan 16, 2020, 1:36:02 PM1/16/20
to TiddlyWiki
Hi Chunk R,
Why you don use <<fnote """{{Footnotes##mypdf}} pg16""">>

- Mohammad

Chuck R.

unread,
Jan 16, 2020, 2:08:26 PM1/16/20
to TiddlyWiki
Thank you, it works! Can you add this example to your plugin on the Usage tab?

Can you also add this example to your Usage tab?
<<fnote {{Footnotes##key}}>>


Mohammad

unread,
Jan 16, 2020, 11:01:55 PM1/16/20
to TiddlyWiki
Sure!
 I will!

--Mohammad

Jon

unread,
Jan 17, 2020, 3:31:28 AM1/17/20
to TiddlyWiki
Hi,


Does this mean you can have a list of references, 1-10 in the Footnotes tiddler and the macro can choose to display reference number 3?
I do hope so!

However, I can't reproduce this example when I try it.

When I do it, <<fnote """{{Footnotes}} pg16""">> shows the contents of the Footnotes tiddler on hover but <<fnote """{{Footnotes##mypdf}} pg16""">> doesn't show "http://www.somewhere.com/mypdf.pdf, pg16" (In the Footnotes tiddler I have [[mypdf|http://www.somewhere.com/mypdf.pdf]])

How is the ##mypdf working? What is it supposed to do?

Regards
Jon

Mohammad

unread,
Jan 17, 2020, 6:33:14 AM1/17/20
to TiddlyWiki
Jon,
 In {{tidName##index}} it retrieves the description from a data tiddler.
fnote only shows the note provided through << fnote """NOTE""">>
This NOTE can be transcluded from other tiddlers like fields or indexes.

--Mohammad

Jon

unread,
Jan 17, 2020, 6:55:48 AM1/17/20
to TiddlyWiki
OK, thanks Mohammad - I'll play around with that.

Jon

Chuck R.

unread,
Jan 17, 2020, 7:26:24 AM1/17/20
to TiddlyWiki
Jon, yes it does.
  1. My tiddler name is a data tiddler and is named "Footnotes".
  2. There is one footnote per line. The format of each line is KEY:REFERENCE DATA. NOTE, the key is case sensitive.

Ex in "Footnotes" data tiddler:
myref1: Smith, John. "Book name", 1990.
myref2: Jones, R. "Another book name", 1999.

So if I want to reference different pages in "myref1" I can do this, enclose reference in one double quote on each end:
<<fnote "{{Footnotes##myref1}} pg16">>

and then this later:
<<fnote "{{Footnotes##myref1}} pg18">>

It's very handy! Then I don't have to make 100 footnote entries, each for a different page reference.

> However, I can't reproduce this example when I try it.

You have too many double quotes in your <<fnote>> macro. Look at my examples carefully, or copy, paste and modify them for your own use. On each side of my reference there is one double quote.

> How is the ##mypdf working? What is it supposed to do?

On a desktop browser, when you save the tiddler, a superscript number will appear. All numbers will be autonumbered for that single tiddler. Move your mouse over the superscript footnote number and at the top of the tiddler the footnote will appear.

I don't know what is does on a mobile browser.

All these formats are not well documented in Mohammed's plugin, and when I tried to documented them in his plugin located in my TW my TW eventually crashed and got a Javascript error. I had to restore it from a backup on Tiddlyspot.

The problem with my editing is I don't yet understand how to use tabs within a tiddler. I thought I had all my different single and double quotes properly matched in my copy of Mohammed's docs but at one point the TW just crashed and would no longer work.


Chuck R.

unread,
Jan 17, 2020, 7:30:23 AM1/17/20
to TiddlyWiki
Just an FYI, it appears Mohammed may have copied his examples from a tiddler in EDIT mode, which has too many double quotes. That's why his examples in this thread do not work. Those extra double quotes are required to display preformatted text in the plugin documentation, but not for the macro to work.

On Friday, January 17, 2020 at 3:31:28 AM UTC-5, Jon wrote:
Hi,


Jon

unread,
Jan 17, 2020, 11:16:45 AM1/17/20
to TiddlyWiki
Hi Chuck,

You're right, that really is very handy and it will revolutionise my wiki.

Many thanks for the explanation.
Regards
Jon

Jon

unread,
Jan 17, 2020, 11:51:56 AM1/17/20
to TiddlyWiki
Hi Chuck,

You might already have this but if not: {{{[!is[system]regexp:text[{{Footnotes##myref1}}]]}}} pasted into a tiddler will give a list of the tiddlers where there is a myref1 reference.

Regards
Jon

Mohammad

unread,
Jan 17, 2020, 1:09:51 PM1/17/20
to TiddlyWiki
Hi Chunk R


On Friday, January 17, 2020 at 4:00:23 PM UTC+3:30, Chuck R. wrote:
Just an FYI, it appears Mohammed may have copied his examples from a tiddler in EDIT mode, which has too many double quotes. That's why his examples in this thread do not work. Those extra double quotes are required to display preformatted text in the plugin documentation, but not for the macro to work.

The tree double quotes here used to cover entries they have themselves single or double quotes.

--Mohammad
Reply all
Reply to author
Forward
0 new messages