mcmtroffaes / sphinxcontrib-bibtex

Sphinx extension for bibtex style references.
Other
180 stars 45 forks source link

show full reference information as html tooltip text #198

Closed eric-wieser closed 3 years ago

eric-wieser commented 4 years ago

It would be great if when hovering over an [ABC123] style citation with the cursor, the full title of the referenced document was shown as html title tooltip text.

mcmtroffaes commented 3 years ago

Apologies for not having responded to this yet. It's a nice idea, but currently I have no idea as to how to implement this. It's not built into sphinx. I did find another extension which provides tooltips on references:

https://github.com/readthedocs/sphinx-hoverxref

It is still in beta. I'll leave this issue open as it would be a nice feature to have eventually.

mcmtroffaes commented 3 years ago

Just to note here that I experimented with hoverxref. Unfortunately it does not yet support custom domains (besides py), so it cannot be used to configure tooltips on sphinxcontrib-bibtex citations, at least as of now. When it supports custom domains, I'd be happy to look at it again.

mcmtroffaes commented 3 years ago

I now found a much simpler solution. The tooltip will be rendered as plain text rather than displaying a full text preview (as with hoverxref) but I think that should be more than enough.

mcmtroffaes commented 3 years ago

Should work now in develop. Thanks again for requesting, it's pretty neat to have this!

Jellby commented 2 years ago

Hmm... Any way of disabling or tweaking the tooltip? I'm using a custom extension to render math inside titles with MathJax, and that doesn't work with plaintext, of course, so my tooltips appear with LaTeX commands. Maybe some "shorthand" format for tooltips (e.g. without title)?

mcmtroffaes commented 2 years ago

Sure, easiest would be to simply disable them, and/or configure the renderer used for tooltips. I've set up a new issue for it.