Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

Feature: switching docs version should retain the current page (if exists) #161

Open
lmammino opened this issue Mar 20, 2020 · 7 comments
Open
Assignees
Labels
help wanted Help the community by contributing to this issue semver-minor Issue or PR that should land as semver minor

Comments

@lmammino
Copy link
Member

lmammino commented Mar 20, 2020

🚀 Feature Proposal

As proposed by @Eomm in #160:

When you switch version in a page (like decorators for ex), the user is sent to the TOC, could we maintain the path changing only the version-path-param?

Motivation + Example

The user might be reading a page, for instance Request, and suddenly realises they are reading the doc for the wrong version. They might switch to the desired version but the switch will bring them to the ToC for that version rather than to the Request page for that version. So they have to navigate manually to the Request page, which requires extra effort.

Potential issue: pages might not exist in all versions

When a page does not exist in a given version, what do we do?

  • Option 1: we don't show the version itself in the dropdown
  • Option 2: we show the version but we point it to the Table of Contents for that version

Any preference @Eomm, @mcollina, @jsumners ?

Possible implementation

  • In the process-releases script, build a data file with an array of all the docs paths available.
  • In the template, where we render the dropdown boxes, we can easily check if a given page exists or not by accessing the data from the file above.
@lmammino lmammino added semver-minor Issue or PR that should land as semver minor help wanted Help the community by contributing to this issue labels Mar 20, 2020
@lmammino lmammino self-assigned this Mar 20, 2020
@jsumners
Copy link
Member

Can it instead go to a page that shows an error message?

@lmammino
Copy link
Member Author

@jsumners are you thinking about a generic error page (generic 404) or a more specific one like the following?

~~~
Sorry the page `Request` does not exist in v.X.Y.Z

[Go somewhere else]
~~~

@jsumners
Copy link
Member

Basically your quote.

@lmammino
Copy link
Member Author

lmammino commented Mar 20, 2020

Where do we go from there? ToC for vX.Y.Z ?

Maybe at that point it could make more sense to just print the entire ToC for vX.Y.Z under the error... 🤔

@mcollina
Copy link
Member

Maybe at that point it could make more sense to just print the entire ToC for vX.Y.Z under the error... 🤔

Yes, this seems about right!

@Eomm
Copy link
Member

Eomm commented Mar 20, 2020

Where do we go from there? ToC for vX.Y.Z ?

Maybe at that point it could make more sense to just print the entire ToC for vX.Y.Z under the error... 🤔

Agree!

@luisorbaiceta
Copy link
Member

luisorbaiceta commented Dec 21, 2021

In my opinion, the common use case scenario will be to first select the version if you are not working with latest. Realizing you are targeting the wrong version I think will hardly ever happen. So just redirecting to the main docs page (as it's done now) I think is the correct solution. Having two different behaviours without signaling the user somehow could mislead them

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Help the community by contributing to this issue semver-minor Issue or PR that should land as semver minor
Projects
None yet
Development

No branches or pull requests

5 participants