kookma / TW-Refnotes

Refnotes is a reference manager tool that allows you to maintain a "personal library" of references, citations, footnotes and abbreviations in Tiddlywiki.
https://kookma.github.io/TW-Refnotes/
37 stars 6 forks source link

Suggestion: <<dfn term dict:"Glossary">> #45

Open techmagus opened 1 day ago

techmagus commented 1 day ago

Hi,

I would like to suggest adding support for <dfn> (). This way we can also define terms, not just abbreviations.

The abbreviation system is already good, I think we just need a new macro(?) like <<dfn term dict:"Glossary">> which generates <dfn>some word or phrase</dfn>, and if a user hovers over it, it pulls data from the dict.

If it's possible to combine the two, at least as per the HTML spec it is allowed (something like: <dfn><abbr title="">HTML</abbr></dfn> (or as examples in the above linked MDL page), it would be great, but not important.

That's all, thank you!

(I'm not sure how to add it manually, but I think if it becomes part of the plugin, everyone will benefit too.)

Regards

kookma commented 21 hours ago

I read the https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dfn I did not understand what the benefit is here! Please explain what you want to get here. I would be happy to add it to plugin once I understand how to use it.

techmagus commented 1 hour ago

Hi,

No worries!

Since <abbr> is used for abbreviations, the <dfn> is used for definitions. For example, in the project I'm restoring we use some existing words differently, we also have words taken from another language (and romanized), and new words invented.

Example sentence: Hyonsil is a collection or group of yekum.

Using the existing features behind <<abbr>> we can do a <<dfn>>.

<<dfn Hyonsil dict:Glossary>> is a collection or group of <<dfn yekum>>. Which will render similarly to <<abbr>> but instead of using the HTML element <abbr> it uses <dfn>; and when a user hovers over it, a tooltip will show up with the definition.

Then in the dict:Glossary we can add words we want to define other than abbreviations.

ap: ActivityPub
fediverse: the social web network powered by ActivityPub protocol
hyonsil: also known as multiverse
kwwp: Kolverse Worldbuilding and Writing Project
yekum: worlds, universes, timelines, dimensions

The above would mean an editor can use <<abbr fediverse>> and <<dfn kwwp>> but I think it's up to the editor to know which one to use (and which dict they have to use in case they have separate ones for abbreviations and definitions).

Of course, it's up to you how you prefer to implement it. It could be totally separate so there's less confusion for editors between <<abbr>> and <<dfn>>.

Regards