readthedocs / sphinx-hoverxref

Sphinx extension to show tooltips with content embedded when hover a reference.
https://sphinx-hoverxref.readthedocs.io/
MIT License
95 stars 40 forks source link

Add configuration to improve large page experience #227

Closed bast0006 closed 1 year ago

bast0006 commented 2 years ago

On significantly large pages (for example, the disnake documentation at https://docs.disnake.dev/en/stable/api.html) sphinx-hoverxref's initialization makes up a very significant portion of page load time (multiple seconds) as it edits the html at load time to add tooltips.

This can be dramatically improved by lazily initializing tooltipster. I wrote some code to prove the concept and speed (visible live at https://disnake--393.org.readthedocs.build/en/393/api.html) and it is a huge improvement.

I'm definitely willing to do what's needed to bring it up to style/etc with the rest of the project. Let me know what needs to be done for it to be mergeable? It'd be lovely to get rid of the page load delay for good.

(Edit: fixed the preview link to point at correct PR, although the other pr also had it active)


:books: Documentation preview :books:: https://sphinx-hoverxref--227.org.readthedocs.build/en/227/


:books: Documentation preview :books:: https://read-the-docs-sphinx-hoverxref--227.com.readthedocs.build/en/227/

bast0006 commented 1 year ago

...github, when I click "re-request review" I do not mean "remove other reviewers" ;-;

onerandomusername commented 1 year ago

Hi, is there any eta on when this might be merged? We're excited to begin to use this at disnake but are waiting on a sphinx-hoverxref release, and I'd like to implement this in our next stable doc release. 🙂

humitos commented 1 year ago

Hi everybody. Thanks for all your work here. I will try to take a final look this week, merge and release a new version 🤞🏼

humitos commented 1 year ago

sphinx-hoverxref==1.2.0 released 🥳 . Please, let me know if everything works as you expected 🙏🏼

benjaoming commented 1 year ago

"soon this week" = 17 minutes later :partying_face:

onerandomusername commented 1 year ago

We've now deployed this change to https://docs.disnake.dev/en/latest/ 😄