sphinx-tabs icon indicating copy to clipboard operation
sphinx-tabs copied to clipboard

Option to collapse tabs by default

Open foster999 opened this issue 5 years ago • 3 comments

Describe the solution you'd like

Following #73, it might be useful to have an option which collapses a set of tabs by default.

Alternatively, it could provide a conifg option to close all tabs by default.

Any call for this?

Probably like:

.. tabs::
   :collapsed:
  
   .. tab :: Stuff

      Content

Implementation could disable addition of active class to first tab.

foster999 avatar Sep 07 '20 19:09 foster999

I'd also like to be able to prevent tabs collapsing on the second click. Not sure if that feature already exists?

robinmacharg avatar Feb 10 '21 14:02 robinmacharg

Good suggestion @robinmacharg - this could certainly be added as a sphinx configuration option

foster999 avatar Mar 06 '21 20:03 foster999

@robinmacharg - I've included this in the latest version via the sphinx config option sphinx_tabs_disable_tab_closing 👍🏻

foster999 avatar Mar 10 '21 18:03 foster999

I tried out sphinx_tabs_disable_tab_closing but it seems to have no effect. I tried using with the alabaster and furo theme both close the tab when I click on it. I have configured in my conf.py following the other option for disable css loading works:

sphinx_tabs_disable_tab_closing = True # does not work
sphinx_tabs_disable_css_loading = True

@foster999 was this option renamed?

alexander-schranz avatar Apr 05 '23 00:04 alexander-schranz

@alexander-schranz, sorry for the slow reply. Do you have an example of this not working?

I've just tried with our docs build and it seems to work. Might be worth deleting the previous build folder and building again, as sphinx might no rebuild if the page content hasn't changed

foster999 avatar Oct 22 '23 20:10 foster999

@foster999 Thx still for your response. I retried it on the project where I did stumble over it but I can not longer reproduce the issue. I since the sphinx and the theme was update, but it could also be a cache issue because not 100% what is being cached in the CI. So for me the option is working now.

alexander-schranz avatar Oct 23 '23 05:10 alexander-schranz

Thanks for confirming, glad to hear it's working now

foster999 avatar Oct 23 '23 09:10 foster999

Closing this, as no further interest in the original suggestion

foster999 avatar Oct 27 '23 18:10 foster999