executablebooks / sphinx-tabs

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

Option to collapse tabs by default #89

Closed foster999 closed 1 year ago

foster999 commented 4 years ago

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.

robinmacharg commented 3 years ago

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

foster999 commented 3 years ago

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

foster999 commented 3 years ago

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

alexander-schranz commented 1 year ago

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?

foster999 commented 1 year ago

@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

alexander-schranz commented 1 year ago

@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.

foster999 commented 1 year ago

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

foster999 commented 1 year ago

Closing this, as no further interest in the original suggestion