Git Product home page Git Product logo

Comments (3)

colegoldsmith avatar colegoldsmith commented on September 28, 2024

@eric-schneider @djsauble I dug into the extension source code a bit and discovered it does have the ability to customize the id of the tabs block, and prefixes that custom id to the individual tabs.

Without a custom id the the extension generates tab ids like tabs-4-python which we can link to.

Using that client example, if we add a custom id install to the tab block like so

[tabs,id=install]
======
Python::
...
TypeScript::
...
Java::
======

The tab ids become install-python install-typescript install-java and we can create a direct link like url/astra-db-vector/get-started/quickstart.html#install-java

Conveniently linking to the individual tab does open it correctly and even opens all other linked tabs. There are a few issues remaining though:

  • The auto scroll doesn't go down far enough and the tab text is covered by the header. This should be an easy fix with the scroll-margin-top css property.
  • Linking to a nested tab does not open the parent tab(s). I could probably do this with some custom js by searching for tab ids when an anchor link is present but it would be a bit of a hack and like you say might break with future versions of the tabs extension.

Is linking to the top level tabs like this a good enough solution?

from docs-ui.

djsauble avatar djsauble commented on September 28, 2024

This is great news, and yes I think as long as we can link to top-level tabs, that's likely a good enough solution for now.

Personally, I think nested tabs are a bit of an anti-pattern, so I'd like to avoid them where possible anyway.

from docs-ui.

eric-schneider avatar eric-schneider commented on September 28, 2024

Agree that we should avoid nested tabs when possible. Though, there are some complex procedures (e.g. Cassandra upgrade) where nested tabs are the only viable option to maintain flow while still presenting the breadth of possible options.

@colegoldsmith, what's the pattern for nested tab IDs? Is it simply tabsetID-tabID-nestedTabID?

Also, what's your take on the two issues I linked? Seems like they're actually unrelated to what we're trying to achieve here, except that maybe we might not have the ability to set custom IDs on individual tabs. Also, neither issue seems appropriate for requesting support for deep linking to nested tabs. Do you think we should open a new issue for that in the upstream project?

from docs-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.