You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a shortcode to show a tooltip that the user can hover over to get extra information.
Problem/Solution
Docs sites often contain words of phrases that the reader isn't very familiar with. Adding a tooltip allows the reader to quickly find out (or remind themselves) what a particular word of phrase means. This is especially helpful when documentation contains lots of acronyms.
Shortcode usage could look something like this:
Lorem ipsum {{< tooltip "Dormouse" >}} more latin [...]
There would likely need to be a configuration file to list all the available tooltips and their descriptions.
Alternatives Considered
Create a separate Glossary page that the user needs to reference.
Add definitions for each uncommon word, phrase, or acronym.
I've done something like this by putting the terms in a YAML datafile and then making two separate shortcodes, one to generate a glossary and one to create tooltips:
The only thing that bothers me about it is that it becomes tedious to write a bunch of abbr shortcodes. Sometime I'd like to experiment with using render hooks instead.
Feature Description
Add a shortcode to show a tooltip that the user can hover over to get extra information.
Problem/Solution
Docs sites often contain words of phrases that the reader isn't very familiar with. Adding a tooltip allows the reader to quickly find out (or remind themselves) what a particular word of phrase means. This is especially helpful when documentation contains lots of acronyms.
Shortcode usage could look something like this:
There would likely need to be a configuration file to list all the available tooltips and their descriptions.
Alternatives Considered
Additional Context
The Flowbite framework (build with Tailwind, I believe) has built something similar: https://flowbite.com/docs/components/tooltips
The text was updated successfully, but these errors were encountered: