cml.dev icon indicating copy to clipboard operation
cml.dev copied to clipboard

tabs: URL referencing

Open casperdcl opened this issue 4 years ago • 6 comments

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)
  • [ ] 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

casperdcl avatar Oct 11 '21 15:10 casperdcl

/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 avatar Oct 18 '21 20:10 julieg18

@julieg18 yes

casperdcl avatar Oct 18 '21 22:10 casperdcl

@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.

julieg18 avatar Oct 18 '21 22:10 julieg18

For now I think we should only support 1 ?tab= (i.e. replace not add upon subsequent clicks)

casperdcl avatar Oct 18 '21 22:10 casperdcl

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 🤔

julieg18 avatar Dec 01 '21 13:12 julieg18

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.

casperdcl avatar Dec 01 '21 14:12 casperdcl