Giter Site home page Giter Site logo

Comments (13)

zeke avatar zeke commented on August 24, 2024 1

What determines the order of the tabs?

Here's the HTML for the tabs: https://github.com/github/docs/blob/5395b9371056e7c8eb9b649e5c1de4de80613155/includes/article.html#L31:L40

Here's the JavaScript file that dynamically updates the tabs and the displayed content on page load: https://github.com/github/docs/blob/main/javascripts/display-platform-specific-content.js

Here's the file where tests should be added for any changes to the existing platform-switching behavior: https://github.com/github/docs/blob/main/tests/browser/browser.js (Note that the platform-switching feature was added before we added this Puppeteer headless browser testing capability, so there are no existing browser tests for the current platform-switching functionality)

I hope that helps, @Simran-B!

from docs.

Simran-B avatar Simran-B commented on August 24, 2024 1

Thanks @zeke for all the information! I created a PR: #1917

Currently, the default tab is Mac.

This isn't the case (anymore?), the default tab is based on the user's operating system, which falls back to Mac if it's none of the supported platforms.

from docs.

Simran-B avatar Simran-B commented on August 24, 2024 1

Yup, see the documentation about the defaultPlatform frontmatter here: https://github.com/github/docs/blob/main/content/README.md#defaultplatform

from docs.

megbird avatar megbird commented on August 24, 2024

@jenschelkopf, while I don't disagree, I don't think there is any way to set a default tab. @github/content-platform-engineering, I've looked in our internal docs but didn't see much information on the context switcher--can y'all confirm that there is technically no way to do this?

If not, we could change the order of the tabs to where linux is first, if no one minds the switcher OS order won't be consistent in our docs. Adding this to our bug fix board 😄

from docs.

zeke avatar zeke commented on August 24, 2024

This seems like reasonable request to me. We could consider introduce a new frontmatter value like defaultPlatform or similar, which would allow content authors to specify this on any articles that need it.

from docs.

timeyoutakeit avatar timeyoutakeit commented on August 24, 2024

I believe this is an engineering issue rather than content (fwiw, it looks like Linux does appear first in the content)

from docs.

zeke avatar zeke commented on August 24, 2024

this is an engineering issue

agreed 👍🏼

from docs.

Simran-B avatar Simran-B commented on August 24, 2024

it looks like Linux does appear first in the content

What determines the order of the tabs? If it's not the content, and if it's also not sorted alphabetically (it's Mac, Windows, Linux in above screenshot), then how does the current tab order come about?

from docs.

github-actions avatar github-actions commented on August 24, 2024

This issue is stale because it has been open 60 days with no activity.

from docs.

jenschelkopf avatar jenschelkopf commented on August 24, 2024

IMO, the tab should not default to the user's OS. The user's OS is not related to the user's runner type. Linux is by far the most common runner type, so we should default to Linux always.

from docs.

Simran-B avatar Simran-B commented on August 24, 2024

I agree that it does not make sense for runners, but what about pages like this one?
https://docs.github.com/en/free-pro-team@latest/desktop/installing-and-configuring-github-desktop/getting-started-with-github-desktop

For the actions docs, Linux can be set as defaultPlatform with my PR on a per page basis.

from docs.

github-actions avatar github-actions commented on August 24, 2024

This issue is stale because it has been open 60 days with no activity.

from docs.

janiceilene avatar janiceilene commented on August 24, 2024

It looks like the work for this one was completed in #1917, so I'm going to close this out!

from docs.

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.