dart-lang / api.dart.dev

Dart API docs
https://api.dart.dev
BSD 3-Clause "New" or "Revised" License
19 stars 17 forks source link

Make it easy to switch between stable/beta/dev/be docs #69

Open kwalrath opened 6 years ago

kwalrath commented 6 years ago

We need an easy way for api.dartlang.org users to switch from the stable channel to the dev channel.

A simple way to do this would be to somehow stick a link on the homepage to https://api.dartlang.org/dev.

A more complex way to do this would be to have a version switcher on every page that tries to take you to the equivalent page in whichever version you select: stable or dev or be.

The sooner the better, since dartlang.org is already on Dart 2. (dartlang.org does take you to the dev version of API docs, but that doesn't help people who type in api.dartlang.org.)

I'll be happy to help with the words, but I couldn't figure out how to implement it myself.

/cc @kevmoo

kwalrath commented 6 years ago

If we have a banner, it could be similar to what we have on www.dartlang.org:

This reference describes Dart 1.[version]. For the Dart 2 API reference, see api.dartlang.org/dev.

kwalrath commented 6 years ago

@jcollins-g do you know how to do this?

jcollins-g commented 6 years ago

@kwalrath

I'm not an expert on the requisite HTML/CSS-fu to do this in a nice-looking way, but I think I could come up with something to programmatically insert whatever we come up with into the documentation.

kevmoo commented 6 years ago

We just have to hand-edit this file and upload it to storage

https://storage.googleapis.com/dartlang-api-docs/gen-dartdocs/stable/1.24.3/index.html

kevmoo commented 6 years ago

@keertip has upload rights. Just need to update the file and ask her nicely to upload it 😃

kwalrath commented 6 years ago

I'll work on the HTML/CSS and then we can talk about how to get that code in there.

kevmoo commented 6 years ago

Excellent

On Thu, Apr 26, 2018 at 9:48 AM Kathy Walrath notifications@github.com wrote:

I'll work on the HTML/CSS and then we can talk about how to get that code in there.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dart-lang/api.dartlang.org/issues/69#issuecomment-384711106, or mute the thread https://github.com/notifications/unsubscribe-auth/AABCijm4ZGJ-uVXQxKRJemHIIrhL9Lidks5tsfpBgaJpZM4TimDY .

kwalrath commented 6 years ago

How about this:

image

kevmoo commented 6 years ago

LGTM

On Thu, Apr 26, 2018 at 10:10 AM Kathy Walrath notifications@github.com wrote:

How about this:

[image: image] https://user-images.githubusercontent.com/2164483/39320760-f9f71c30-4939-11e8-8dcc-ec1195251605.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dart-lang/api.dartlang.org/issues/69#issuecomment-384717875, or mute the thread https://github.com/notifications/unsubscribe-auth/AABCijv2rLu8MM-5QBUBWBlevqiOB27nks5tsf90gaJpZM4TimDY .

kwalrath commented 6 years ago

The new text in index.html is the first <p> element in the following <section>:

      <section class="desc markdown">
        <p style="background: #e2f4fd; padding: 20px">
          This documentation covers <b>Dart 1.24.</b>
          For the <b>Dart 2</b> API reference, see
          <b><a href="https://api.dartlang.org/dev">api.dartlang.org/dev</a>.</b>
        </p>
        <p>Welcome to the Dart API reference documentation, covering the official Dart API
kwalrath commented 6 years ago

We have the simple fix up. It'd be nice to implement a real switcher, but that isn't as urgent.

kwalrath commented 3 years ago

Now that we have even more channels, we should make it easy to switch between the stable, dev, beta, & be docs. I recently had to tell someone about the be docs: https://github.com/dart-lang/site-www/issues/2518#issuecomment-692835818.

Adding a 404 (#19, from 2013!) would be part of this work.