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 glossary tooltip feature #555

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft

Conversation

josh-wong
Copy link
Member

@josh-wong josh-wong commented Oct 29, 2024

Caution

This PR should not be merged until after our glossary is published.

Description

This PR adds a tooltip feature that shows the definition of terms from our glossary.

The tooltip appears on only the first mention within the content of the doc, whether it's in a paragraph, ordered or unordered list, or table. The tooltip doesn't appear in headings, links, or code blocks.

In addition, the tooltip shows English definitions on English pages and Japanese definitions on Japanese pages.

Note

The glossary tooltip feature appears only in production environments.

Related issues and/or PRs

  • <ADD_LINK_THAT_ADDS_GLOSSARY>

Changes made

  • Add Typescript files that
    • Recognizes terms when they appear on a page.
    • Render the definition in a tooltip for that recognized term.
  • Add Javascript file that creates a .json file from the English and Japanese glossary.mdx docs in the folder for the latest release.
  • Add styles for tooltip.

Checklist

The following is a best-effort checklist. If any items in this checklist are not applicable to this PR or are dependent on other, unmerged PRs, please still mark the checkboxes after you have read and understood each item.

  • I have updated the side navigation as necessary. N/A
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes. N/A
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

N/A

@josh-wong josh-wong added the enhancement New feature or request label Oct 29, 2024
@josh-wong josh-wong self-assigned this Oct 29, 2024
@josh-wong josh-wong changed the title Add definition tooltip feature Add glossary tooltip feature Oct 29, 2024
@josh-wong josh-wong force-pushed the add-definition-tooltip-feature branch from 8517684 to c112436 Compare October 29, 2024 06:08
Copy link

netlify bot commented Oct 29, 2024

Deploy Preview for staging-scalardl-docs-site canceled.

Name Link
🔨 Latest commit d8f9bc3
🔍 Latest deploy log https://app.netlify.com/sites/staging-scalardl-docs-site/deploys/672089731ebabd00080ebeba

On desktop: Increase padding around definitions.
On mobile: Add styles to keep the tooltip within view on narrow screens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant