executablebooks / sphinx-tabs

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

Can't deeplink a tab #145

Open theletterf opened 2 years ago

theletterf commented 2 years ago

Describe the problem

As the tabs seem to like anchors and/or a mechanism to deep link content, this causes search results not to enable the right tab. You can replicate this even in your docs site: https://sphinx-tabs.readthedocs.io/en/latest/search.html?q=Windows+tab+content+-+tab+set+1&check_keywords=yes&area=default

Link to your repository or website

https://sphinx-tabs.readthedocs.io/en/latest/search.html?q=Windows+tab+content+-+tab+set+1&check_keywords=yes&area=default

Steps to reproduce

  1. Search for content that lives in a tab that is not focused by default (not the main tab)
  2. Click search result
  3. Notice how the tab is not enabled

The version of Python you're using

3.9.7

Your operating system

macOS

Versions of your packages

No response

Additional context

No response

foster999 commented 2 years ago

The linked search above doesn't offer content within a tab as one of the options for me. It shows the content from the code-block above the tabs, which it opens to correctly:

... - tab set 1 .. group-tab:: Windows Windows tab content - tab set 1 .. tabs:: .. group-tab:: Linux Linux ...

Do you have an example on a different document where the search identifies text within a closed tab?

I think this might require implementing something like #47 suggests. At the moment, tab opening is triggered by clicking only, not by URL.