Experimenting "notetips" macro.

146 views
Skip to first unread message

Julio Peña

unread,
Apr 6, 2020, 10:12:04 AM4/6/20
to TiddlyWiki
Hello all,

I hope everyone is doing well and safe at home during these turbulent times.

I will need pointers on how to improve the little experimentation I'm undertaking.
I call it a "notetip". It's an implementation of the tooltip mechanism 
for quick reference "glances". I know there are many fine reference modules
developed by the community...however I wanted something rather simple
to continue the flow of writing.


Please click on the " Featured Samples" tab and let me know how I can improve upon
this little tool.

Thanking you all in advance,
Julio

Saq Imtiaz

unread,
Apr 6, 2020, 4:01:01 PM4/6/20
to TiddlyWiki
I am not entirely sure I understand what improvement you are trying to make.

If the macros are meant to use fields from the same tiddler they are called in, try this to make the macro more reusable:

\define nt(text,field)
<$link to=<<currentTiddler>> class="no-click" tooltip="{{!!$field$}}"><sup>$text$</sup></$link>
\end

and call it like <<nt "[[4|nt-4]]" "nt-4">>

Julio Peña

unread,
Apr 6, 2020, 6:03:22 PM4/6/20
to TiddlyWiki
Hello there Saq,

Worked as prescribed...it was the improvement I was looking for.
Much appreciated. 

Thanks for the pointer!

Blessings,
Julio

Saq Imtiaz

unread,
Apr 6, 2020, 6:12:15 PM4/6/20
to TiddlyWiki
This might make life even easier by simplifying the parameters to the macro to just the text to display, and the field.

\define nt(text,field)
<$link to=<<currentTiddler>> class="no-click" tooltip="{{!!$field$}}"><sup>[[$text$|$field$]]</sup></$link>
\end

<<nt "4" "nt-4">>

Julio Peña

unread,
Apr 6, 2020, 7:51:17 PM4/6/20
to TiddlyWiki
Oh man...u da man Saq...that is wonderful!
Thanks again!

Regards,
Julio

Mohammad

unread,
Apr 7, 2020, 5:51:46 AM4/7/20
to TiddlyWiki
Also give a try on this (Demo: Saq Notetip 1)

\define nt(text,field)
<$set name=tip tiddler=<<currentTiddler>> field=<<__field__>> >
<sup title=<<tip>> style="color:red; cursor:help;">$text$</sup> <<tip>>
</$set>
\end


```
As per Saq Imitaz's suggestion: it works as prescribed!
```

Lorem ipsum dolor sit amet,<<nt 1 "nt-1">> consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.<<nt 2 "nt-2">> Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.<<nt "3" "nt-3">> Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<<nt 4 "nt-4">>


Change the style to meet your requirement!

Julio Peña

unread,
Apr 7, 2020, 9:54:42 AM4/7/20
to TiddlyWiki
Mohammad hello,

I hope you find yourself well.
Wow...a VERY elegant solution!
Thanks a million.
Added to my notes!

All the best,
Julio

Mohammad

unread,
Apr 7, 2020, 11:43:37 AM4/7/20
to tiddl...@googlegroups.com
Hi Julio,
 I am fine thank you! Hope you are fine in this pandemic!

I am sure you find the small mistake in the code I sent:

\define nt(text,field)
<$set name=tip tiddler=<<currentTiddler>> field=<<__field__>> >
<sup title=<<tip>> style="color:red; cursor:help;">$text$</sup>
</$set>
\end


There was a <<tip>> at end of line 3! 

Cheers
--Mohammad

Julio Peña

unread,
Apr 7, 2020, 6:27:01 PM4/7/20
to TiddlyWiki
Mohammad...I'm doing well here also.
Yes...duly noted.
Thanks again!

Regards,
Julio
Reply all
Reply to author
Forward
0 new messages