-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for tabs / tabset panels #121
Add support for tabs / tabset panels #121
Conversation
Add css styling for tabs and javascript to make them keyboard navigable.
Add in group-tabs like sphinx-tabs has. These are persistent across sessions and pages.
To test the new tab and group-tab you will also need: |
Thank you for this PR @astroDimitrios, and for the excellent description and documentation. I do see this feature being very useful, especially for our workshop setup pages (for example https://datacarpentry.org/ecology-workshop/setup-python-workshop.html), which are currently using the |
@astroDimitrios I'm curious! Could you give an example here of how this would be encoded in the source Markdown of an episode, please? Or share a link to documentation where I could learn more on my own? |
Hello! Apologies it seems I only added in the .md syntax in the corresponding sandpaper pull request: carpentries/sandpaper#571 But basically:
or for a group tab:
|
Great, thank you for sharing @astroDimitrios. Sorry I did not think of going to check the other PRs! This looks very simple from an authoring perspective, which is encouraging. |
Sometimes when hovering over a non-active tab header the outline is hidden. This should fix. This also text-underlines non-active tabs to emphasise the separation between the headers.
Closes #32.
This request adds in css styling and javascript for tab and group-tab panels.
The css currently styles the panels like this:
(with an outline on hover for non-active tabs which I forgot to screenshot)
The javascript makes the tabs navigable using a keyboard and syncs any group-tabs.
The selected group-tab persists over the session. So say if you have group-tabs with names Linux, and Windows etc like below, and select Windows on one page the JS will:
I have made the decision to autoload tabs when clicked or navigated to using the keyboard arrows. Not sure if this was correct so happy to hear thoughts on this.
The JS was adapted from sphinx-tabs which is MIT license.