dartdoc icon indicating copy to clipboard operation
dartdoc copied to clipboard

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

Open kwalrath opened this issue 7 years ago • 12 comments

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 avatar Apr 25 '18 00:04 kwalrath

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 avatar Apr 25 '18 00:04 kwalrath

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

kwalrath avatar Apr 25 '18 22:04 kwalrath

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

jcollins-g avatar Apr 26 '18 15:04 jcollins-g

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 avatar Apr 26 '18 16:04 kevmoo

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

kevmoo avatar Apr 26 '18 16:04 kevmoo

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

kwalrath avatar Apr 26 '18 16:04 kwalrath

Excellent

On Thu, Apr 26, 2018 at 9:48 AM Kathy Walrath [email protected] 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 .

kevmoo avatar Apr 26 '18 16:04 kevmoo

How about this:

image

kwalrath avatar Apr 26 '18 17:04 kwalrath

LGTM

On Thu, Apr 26, 2018 at 10:10 AM Kathy Walrath [email protected] 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 .

kevmoo avatar Apr 26 '18 17:04 kevmoo

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 avatar Apr 26 '18 17:04 kwalrath

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

kwalrath avatar Apr 26 '18 18:04 kwalrath

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.

kwalrath avatar Sep 15 '20 16:09 kwalrath