Skip to main content

sphinx-peek

PyPI

Sphinx extension for peeking at references

In Development!

The extension adds a small icon next to select references, that can be clicked to peek at the target of the reference.

  • Resizable modal window
  • Anchored to the reference during scrolling and window resizing
  • Nested reference peeking supported

See documentation at https://sphinx-peek.readthedocs.io/

Development notes

Yet another sphinx-extension for previewing links!

Aims:

  • As simple as possible
  • All CSS and JavaScript is bundled with the extension

There is already:

  • sphinx-hoverxref:

    This works by adding specific HTML classes to certain internal and intersphinx references, and then using JavaScript to show a preview window on mouseover, which is populated with content obtained by making an API call to the ReadTheDocs server.

    The key drawback of this approach is that it only works when the documentation is being served by ReadTheDocs. Also intersphinx previews only work when the target documentation is also being served by ReadTheDocs.

  • sphinx-tippy

    This works by creating all preview content in advance, during the build process, and uses tippy.js to show the preview window on mouseover.

    A drawback is that it can be difficult to make the preview content look good, and integrate with the rest of the documentation theme.

  • sphinx-preview

    This works by using Javascript to add iframe windows for previewing.

Changes to sphinx-preview

This extension adapts the approach of sphinx-preview, but makes some changes including:

  1. Replaces the use of JQuery with vanilla JavaScript
  2. Always uses clickable icons to show the preview window, rather than mouseover hover (I feel this gives the user more control, and understanding of which links are preview-able)
  3. Fixes some bugs with the scroll-to-anchor behaviour, and preview window positioning
  4. Adds anchoring of the preview window to the reference, during scrolling and window resizing
  5. For development purposes, also adds JSDoc type annotations to the JavaScript code and uses pre-commit hooks to check the formatting and type safety of the code.

Release files for sphinx_peek 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx_peek 0.0.3
File Size Uploaded
sphinx_peek-0.0.3.tar.gz 40.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx_peek 0.0.3
File Interpreter ABI Platform
sphinx_peek-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 40.8 MB

Release files / sphinx_peek-0.0.3.tar.gz

Download URL sphinx_peek-0.0.3.tar.gz
Size 40.8 MB
Tags Source
SHA-256 checksum
How to use checksums
28460d21cf09e6f39e83c153d3c5cb725aefdec51e39d6cc81a931f512066487
BLAKE2b-256 checksum
How to use checksums
e11039b3ba7afc7656a8f87e9dd331fe47143e2bf083f598853888d3b7db6c70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / sphinx_peek-0.0.3-py3-none-any.whl

Download URL sphinx_peek-0.0.3-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4227328e49052047f7404d08354627eb65dea26393839325e34b0a75fdb47c56
BLAKE2b-256 checksum
How to use checksums
ec82e3a5b6a11060586ecfd91789a0fbce0dc1b35c249ffa8d0ba748c86897ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page