Skip to content

Add tippy.js support into the theme #212

Merged
svekars merged 1 commit intopytorch_sphinx_theme2from
enable-tooltip-hoverxref
Dec 16, 2025
Merged

Add tippy.js support into the theme #212
svekars merged 1 commit intopytorch_sphinx_theme2from
enable-tooltip-hoverxref

Conversation

@svekars
Copy link
Contributor

@svekars svekars commented Dec 16, 2025

Adds support for glossary tooltips in the PyTorch Sphinx Theme using the sphinx-tippy extension.

  • Added a new docs/glossary.md file containing definitions for common PyTorch terms for testing.
  • Created docs/test-glossary.md for testing.
  • Updated docs/index.rst to include a reference to the glossary in the indices and tables section for testing
  • Enabled the sphinx_tippy extension and added configuration for tooltip appearance and interactivity in docs/conf.py, along with intersphinx_mapping for external documentation references.
  • Implemented a setup_tippy_defaults function in pytorch_sphinx_theme2/__init__.py to set sensible default tooltip behaviors, such as anchor selection and skip rules, and registered it with the Sphinx app.
  • Added extensive SCSS for .tippy-box to ensure tooltips match the PyData Sphinx Theme’s light/dark modes, with custom styles for links, code, lists, and glossary formatting
  • Compiled the theme.css with npx grunt docs
  • For now, {term} links in the glossary itself won't work but if this gets merged, they will: Add tippy_glossary_base_url to fix broken glossary term links in tooltips sphinx-extensions2/sphinx-tippy#33.

@meta-cla meta-cla bot added the cla signed label Dec 16, 2025
@svekars svekars force-pushed the enable-tooltip-hoverxref branch from dc1c547 to 9bfadcb Compare December 16, 2025 21:11
@svekars svekars force-pushed the enable-tooltip-hoverxref branch from 9bfadcb to 15a30c6 Compare December 16, 2025 22:48
@svekars svekars merged commit 5b6d2df into pytorch_sphinx_theme2 Dec 16, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants