Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Notification when viewing outdated version of API docs #9916

Open
straight-shoota opened this issue Nov 14, 2020 · 1 comment
Open

Comments

@straight-shoota
Copy link
Member

straight-shoota commented Nov 14, 2020

There is an ongoing problem when readers of the online API docs on https://crystal-lang.org/api land on documentation for an older crystal version which doesn't accurately reflect the current API. One reason for this is that search results tend to point to older versions (this is a separate issue discussed in #5952). Even when this is fixed, readers might be following links from blog posts etc. which point to older versions (this can be avoided by linking to https://crystal-lang.org/api/latest/ instead of a specific version).

When landing on such a page, it is hard to notice that the information is (or may be) outdated. Since 0.35.0 the version is shown on page in the side bar and a version selector allows to jump to different versions. But even that may not immediately jump into the eye. And it requires the reader to familiar with which version is the most recent. With older releases (prior to 0.35.0) you can only tell from the URL which version you're actually viewing.

The proposed solution to make readers aware of outdated documentation is to show a notification, preferably a bar at the top of the page. An example can be found in the Python docs: https://docs.python.org/3.4/

This document is for an old version of Python that is no longer supported. You should upgrade, and read the Python documentation for the current stable release.

There was previously already a PR for this: #7011 based on querying and compering to the /api/latest redirect.

Now we could use the version data already available for the version selector to generate this alert. That would certainly work, but it has a few shortcomings:

  • It depends on JavaScript. Outdated version alert in docs #7011 is pretty clever about this with a noscript-message: "This documentation may be out of date. Click here to visit the latest version." It helps for users without JS. But after clicking that link, you would still see the same message and don't really know if it was successful or not. And machines consuming the site without JS evaluation would be oblivous to the fact.
  • It doesn't work retroactively. We currently have documentation for over 30 outdated versions. Adding notifications to these is most important right now. So we'll need a different solution to achieve that anyways.

I propose to inject the notification directly into the hosted HTML files instead.
That's certainly some effort, you need to fetch all the files from s3, inject the content and then reupload. But this can be easily automated. And it's only necessary once for each version. The idea to inject the version selector data that way was dismissed because it would require an update for every release. But the status change from recent to outdated only happens once.
Maybe we'll eventually have more support status changes (like outdated but still supported) but it's still very limited per file.

So I think this would be a feasible approach to update the already existing outdated docs, as well as current and future docs as soon as they become outdated. This could just be a step in the release process: When a new documentation version is pushed, the old one gets the outdated notification.

@rdp
Copy link
Contributor

rdp commented Sep 8, 2021

Looking forward to this after googling "crystal stdout" took me to https://crystal-lang.org/api/0.18.7/toplevel.html today... :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants