-
Notifications
You must be signed in to change notification settings - Fork 28
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
Linked content tabs #61
Comments
Should the I can see how it would be useful to specify an identifier for a non-text label (although for accessibility it would probably be good to have a text label as well even if you want to display an icon), or as an override, but it seems like in almost all cases you would just want to mark an entire tab-set as linked (and use the text of the tab label as the key). In the same case, you link multiple tab sets that all have the same set of labels. In that case it is pretty obvious what the behavior should be --- their selected tabs should remain the same at all times. However, it is a bit trickier if some tabs are linked but not others. For example, suppose the tab labels correspond to programming language, but not all tab sets include all programming languages. E.g. first tab set has "C", "Java", "Python" and the second one has "Java", "Python", "JavaScript". Presumably if we select "Java" or "Python" in one we want it to be selected in the other. If we select "C" in one --- presumably the other remains unchanged. So we would need to choose a representation in |
Glad to see you're already thinking about the implementation details. Since I'm not a JS expert, I'd probably look for inspiration from similar implementations (like sphinx-design ext). Just to throw it out there, sphinx-design also supports a special directive aimed at linking tabs based on specified syntax. I think we can support a
It does make sense to let As for accessibility, I don't think this is high priority on upstream (table type code-blocks with line numbers are non-default in sphinx for this reason - inline line numbers are default for screen readers and such). I'm not saying to ignore it, but it would be nice to also accommodate accessibility standards also. |
In response to #111 (comment) Awesome! I didn't see that in the release notes. Currently, we're pinned to v8.2.8, but I can adjust our RST ext (concerning content tabs) as soon as we do another merge-from-upstream. |
This no longer accurate. This should be resolved by #171 because there was no need to alter the content tabs' directives. 🚀 |
I started a discussion in mkdocs-material about exempting tabs (or tab sets) from being synced. |
I got a response in the discussion. Ultimately, there isn't a way to specify an unique attribute/class/option to content tabs in MD. There is currently a significant ongoing effort to introduce a directive syntax that was inspired by MyST syntax, but the current MD syntax in mkdocs is a bit too mature at this point to expect users to instantly switch to the new directive syntax (if/when it finally goes mainstream). ConclusionWe'll have to diverge a bit from upstream JS to allow exemptions/exceptions about linked content tabs (or entire tab sets). |
* update merge script for missing files in git index * updates from upstream v8.5.6 * update official github action versions in CI * resolve #61 - enables linked content tabs and explains/demos how to use them in docs * document how to change the "edit this pg" icon * document changing admonition icons * doc announce block & use announce.dismiss feature * doc user feedback feature * allow use of consent popup (no docs for it though) * revert metadata keys' name changes - approved workaround to sphinx-doc/sphinx#10932 is to use a blank line at start of doc before metadata
Well, it looks like linked content tabs will remain an insiders feature only. Originally, I thought the feature would get included in the public releases when the upstream funding goal hit $5000+, but the linked tabs feature wasn't made public when that goal was recently met.
So, we have to implement linked tabs ourselves.
Implementation
I envision this as a
:linked:
option to themd-tab-item
directive. This could be a flag (option accepts no value) or an option that expects an identifying string.The text was updated successfully, but these errors were encountered: