executablebooks / sphinx-tabs

Tabbed views for Sphinx
https://sphinx-tabs.readthedocs.io
MIT License
265 stars 68 forks source link

Images and math in tab headings broken in 2.0.0 #101

Closed jmd-dk closed 3 years ago

jmd-dk commented 3 years ago

Describe the bug

Placing images and math in tab headings/titles does not work in version 2.0.0.

To Reproduce / Expected behavior

I'm not sure if it is (was) a deliberate feature, but prior to 2.0.0 one could have tabs like what is shown here. The Sphinx code generating this is of the form

.. tabs::

   .. tab:: |linux| :math:`\,\,` Linux

      Tab 1 text...

   .. tab:: |windows| :math:`\,\,` Windows

      Tab 2 text

where |linux| and |windows| are images defined as

.. |linux| image:: /_static/linux.png
   :height: 35px

.. |windows| image:: /_static/windows.png
   :height: 35px

I use :math: simply to produce some whitespace between the images and the titles.

With sphinx-tabs 2.0.0 we get the following: tabs Neither the image nor the math is rendered. It's as though the RST-text isn't getting parsed but just used raw, as is.

Environment

welcome[bot] commented 3 years ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

Daltz333 commented 3 years ago

I'm not sure if this is just intentionally not supported. Images in tab headings is non-trivial and won't look good for most cases. This may be where you might want to look into Sphinx-Panels navigation

foster999 commented 3 years ago

Think this might be the same issue as #100. It sounds like v2.0.0 doesn't doesn't use nested parsing on the tab labels, so these directives are getting ignored. Shouldn't be too hard to add this back in.

The example with images linked above actually looks quite neat!