executablebooks / sphinx-tabs

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

Select which tab to focus #138

Open mklomp opened 3 years ago

mklomp commented 3 years ago

Description / Summary

It would be nice if it could be possible to auto-select a tab on load. At the moment the first tab is always active.

Value / benefit

In order to explain the user what to type in which terminal I am planning on using tabs to show the 'status' of multiple linux terminals. It would help if the new 'terminal' tab would the be active.

Implementation details

No response

Tasks to complete

No response

foster999 commented 3 years ago

I'm not clear what the "new" tab references here. Are tabs being dynamically added on a page in this use case? If yes, I'd recommend using custom JavaScript to select the new tab.

Otherwise, please could you provide more details on:

  1. The behaviour you'd like to see
  2. How you'd like to specify this behaviour in markdown
chrisjsewell commented 3 years ago

I'd imagine it would be similar to the selected option in https://sphinx-design.readthedocs.io/en/furo-theme/tabs.html#tab-item-options 😉

foster999 commented 3 years ago

Cheers @chrisjsewell - what happens here if a user marks multiple tabs as selected in a set?

mklomp commented 3 years ago

@foster999, as far as I can see this would indeed be similar to the selected option mentioned by @chrisjsewell. I see that my description with the 'new' tab indeed might be a bit unclear ;).