Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tooltip shortcode #444

Open
johnnymatthews opened this issue Aug 20, 2024 · 1 comment
Open

Add Tooltip shortcode #444

johnnymatthews opened this issue Aug 20, 2024 · 1 comment

Comments

@johnnymatthews
Copy link

johnnymatthews commented Aug 20, 2024

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:

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

  1. Create a separate Glossary page that the user needs to reference.
  2. Add definitions for each uncommon word, phrase, or acronym.

Additional Context

The Flowbite framework (build with Tailwind, I believe) has built something similar: https://flowbite.com/docs/components/tooltips

image

@MattDodsonEnglish
Copy link

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:

https://wellshapedwords.com/posts/hugo-manage-terminologies/#more-uses-of-the-termbase

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants