readthedocs / sphinx-hoverxref

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

Support sphinx-design tabs #251

Open jhj0411jhj opened 1 year ago

jhj0411jhj commented 1 year ago

hoverxref_sphinxtabs = True seems not work with sphinx-design tabs (github). The reference page in my docs is written in markdown. Can it be supported?

benjaoming commented 1 year ago

Hi @jhj0411jhj

Can you elaborate this a bit? Do you mean that the tabs do not render well in the tooltip?

jhj0411jhj commented 1 year ago

@benjaoming I write tabs using sphinx-design tabs syntax, with hoverxref_sphinxtabs = True (I guess it only work with sphinx-tabs, but both of these tabs are developed by executablebooks).

When I hover over the link, the tooltip is shown. The first tab renders well. However, when I switch to the second tab in hoverxref's tooltip, the contents in the second tab is gone. And when I switch back to the first tab, the content also disappears.

See this docs for example (will be available for a while), and see the inline-tabs before ## test tabs: https://test-docs-jhj.readthedocs.io/en/latest/test_md.html#test-tabs

humitos commented 1 year ago

This probably happens because of the way that hoverxref re-triggers the render of the tabs: https://github.com/readthedocs/sphinx-hoverxref/blob/f91ea099bb0fe3bdd9f40edbc787a11a7c3fcc64/hoverxref/_static/js/hoverxref.js_t#L39