-
-
Notifications
You must be signed in to change notification settings - Fork 27
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 #571
Add support for tabs / tabset panels #571
Conversation
Fix the id's of the buttons and the tabpanels so that the buttons control the correct tabpanel.
Modify the lua filter for the tab block to also create group-tabs.
Add in extra comments for the group tab filter.
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 - Thanks for your patience. I've finally had some time to play around with this and, although I'm able to get this up and running, I am seeing some odd behavior that I'm wondering if we could change.
In the above screenshot, the "Windows" tab title appears. It is prefixed by a single hashtag in the markdown file. In the above screenshot, the "Windows" tab title does not appear. it is prefixed by a double hastag in the markdown file.
In the above screenshot, content formatted as an unordered list does not appear at all in the tab callout. In the above screenshot, content formatted as an unordered list appears, but without list formatting. In the above screenshot, numbered list items appear (with list formatting removed) and unordered list items do not appear at all. Installation instructions are likely to be a common use case for tabbed callout boxes, so the ability to render lists (and especially ordered lists) seems pretty important. Do you think there's a way to incorporate this?
I'd personally be pretty excited to get this new feature incorporated into the Workbench, as I think it's a pretty big improvement over our current method for showing installation instructions across different platforms using spoiler class callouts (example below). Do you think it would be possible to incorporate changes mentioned in items 1 and 2 above? @froggleston and I can take a look at the styling (item 3) if that's outside of your wheelhouse. Not that it's in our wheelhouse either! 😂 |
…support for lists
New syntax:
Screenshot below showing altered styling and an unordered list: |
@astroDimitrios I just wanted to understand the functionality of group tabs, does that mean if I make a selection for one set of tabs, the same selection is made for the other set(s). The reason I'm asking is that I would have liked to make the default tab configurable (so I could choose between a SLURM tab and a PBS tab in the configuration file for my use case). I could live without that though if they only had to select the tab once and the choice would propagate through. |
Hi @ocaisa for group tabs clicking once on say the Windows tab turns all other group tabs to windows and will remember the users choice :) |
Thank you so much again for your contribution @astroDimitrios ! You can see your tabs in the wild in the sandpaper docs 😄 https://carpentries.github.io/sandpaper-docs/episodes.html |
What: This pull request adds support for tab and group-tab admonitions/panels. They are based off sphinx-tabs. It does this by adding an extra lua filter.
Why: So I can have a tab of instructions for each computer platform which sync (group-tabs) across episodes. Tabs are also useful when teaching compiled languages as I can have a tab for each compiler.
Syntax:
tab
Output:
group-tab
Output:
The underlying functionality is all handled by bootstrap tabs. I have used the resources mentioned in carpentries/varnish#32 to get the aria labels right and the JS is based of sphinx-tabs.
Caveats
I have added a lot to the lua so I'm happy to have a zoom etc chat if anyone is looking at the code as part of a review.
To test this change you will need the corresponding varnish and pegboard changes: