tabs: URL referencing
Given:
<!-- /some/page.md -->
<toggle>
<tab title="Foo">
</tab>
<tab title="Bar">
some text
### sub section
</tab>
</toggle>
Should be able to use:
- [x]
/some/page?tab=Bar(or/some/page#Bar?) to auto-open the appropriate tab (p1-important, #130)- [x]
/some/page/?tab=Bar#sub-section(or/some/page#Bar-sub-section?) to auto-open the tab and scroll to containing section (p2-nice-to-have)
- [x]
- [ ] remember the
?tab=<arg>when navigating to a different page (p2-nice-to-have)
Other tasks:
- [x] initial tabs implementation (#113)
- [ ] update styling a little (#136, TODO: follow-up)
- [x] ~blocking #122~
- related #70
/some/page?tab=Bar (or /some/page#Bar?) to auto-open the appropriate tab (p1-important)
Do we want the tab query to be automatically added to the url when the user clicks on a tab?
@julieg18 yes
@julieg18 yes
Do you think this could make urls look lengthy if we had multiple different sets of tabs on one page? For example: https://cml.dev/doc/cml-with-dvc?tab=google-cloud-storage&tab=windows.
For now I think we should only support 1 ?tab= (i.e. replace not add upon subsequent clicks)
remember the ?tab=
when navigating to a different page (p2-nice-to-have)
Are we sure we want this behavior? Currently it seems like we don't have many similiar tab names minus github, gitlab, and bitbucket 🤔
Are we sure we want this
yes, the GH/GL/BB tabs are important and frequent enough to make this desirable on https://cml.dev/doc. Potentially could clear ?tab=X only when navigating to a page that doesn't contain an X tab.