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: Version switcher is broken / misleading #23979

Closed
bnb opened this issue Oct 30, 2018 · 8 comments
Closed

docs: Version switcher is broken / misleading #23979

bnb opened this issue Oct 30, 2018 · 8 comments
Labels
doc Issues and PRs related to the documentations.

Comments

@bnb
Copy link
Contributor

bnb commented Oct 30, 2018

Currently if you try to switch to other semver major versions of the same docs on the docs site, you get extremely inconsistent results. Questions I had as I was going throught

As an example, here are the HTTP/2 docs:

v8.x
image

v9.x (where is v8.x?)
image

v10.x (where is v8.x, and why wasn't this doc listed on the v8.x or v9.x docs pages?)
image

v11.x (why wasn't this listed on any of the other pages?)
image

I experienced this in a few other docs pages as well.

@addaleax addaleax added the doc Issues and PRs related to the documentations. label Oct 30, 2018
@addaleax
Copy link
Member

I’m not sure who to ping for this, but I’m sure @rubys or @vsemozhetbyt would know?

@richardlau
Copy link
Member

richardlau commented Oct 30, 2018

Not sure of the answer to all of the questions, but at least for:

v11.x (why wasn't this listed on any of the other pages?)

I think we need to add to:

node/tools/doc/html.js

Lines 403 to 416 in 2cab511

function altDocs(filename, docCreated) {
const [, docCreatedMajor, docCreatedMinor] = docCreated.map(Number);
const host = 'https://nodejs.org';
const versions = [
{ num: '10.x' },
{ num: '9.x' },
{ num: '8.x', lts: true },
{ num: '7.x' },
{ num: '6.x', lts: true },
{ num: '5.x' },
{ num: '4.x' },
{ num: '0.12.x' },
{ num: '0.10.x' }
];

and get it backported to all non-EOL release lines. I'll raise a PR (edit: #23980).

@refack
Copy link
Contributor

refack commented Oct 30, 2018

So AFAICT it depends on what was backported when...
I think since v8.0.0 did not have HTTP/2 our inference logic fails.
Also we have the limitation that once a doc version was built it is static. ATM we don't have a way to update it of newer versions.

@vsemozhetbyt
Copy link
Contributor

If we want this to work for backported docs, maybe we need to move this from doctools to some webpage dynamic script.

@sagitsofan
Copy link
Contributor

It is possible, but i am not sure it is worth all the hard work for that small feature.
Maybe just fix it manually in the backported docs?

@Trott
Copy link
Member

Trott commented Nov 25, 2018

The cause here is a bug in tools/doc/html.js. PR coming shortly.

Trott added a commit to Trott/io.js that referenced this issue Nov 25, 2018
The processing of strings like `8.x` into a major version number and a
minor version number results in minor versions that are `NaN`. In that
situation, since the picker will link to the latest docs in the
major version, include the version in the version picker.

Fixes: nodejs#23979
@Trott
Copy link
Member

Trott commented Nov 25, 2018

Proposed fix in #24638

Trott added a commit to Trott/io.js that referenced this issue Nov 28, 2018
The processing of strings like `8.x` into a major version number and a
minor version number results in minor versions that are `NaN`. In that
situation, since the picker will link to the latest docs in the
major version, include the version in the version picker.

Fixes: nodejs#23979
PR-URL: nodejs#24638
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
@Trott
Copy link
Member

Trott commented Nov 28, 2018

Fix landed in 6f64cda. Not sure why this didn't auto-close....

@Trott Trott closed this as completed Nov 28, 2018
targos pushed a commit that referenced this issue Nov 28, 2018
The processing of strings like `8.x` into a major version number and a
minor version number results in minor versions that are `NaN`. In that
situation, since the picker will link to the latest docs in the
major version, include the version in the version picker.

Fixes: #23979
PR-URL: #24638
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
refack pushed a commit to refack/node that referenced this issue Jan 14, 2019
The processing of strings like `8.x` into a major version number and a
minor version number results in minor versions that are `NaN`. In that
situation, since the picker will link to the latest docs in the
major version, include the version in the version picker.

Fixes: nodejs#23979
PR-URL: nodejs#24638
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
BethGriggs pushed a commit that referenced this issue Feb 12, 2019
The processing of strings like `8.x` into a major version number and a
minor version number results in minor versions that are `NaN`. In that
situation, since the picker will link to the latest docs in the
major version, include the version in the version picker.

Fixes: #23979
PR-URL: #24638
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
rvagg pushed a commit that referenced this issue Feb 28, 2019
The processing of strings like `8.x` into a major version number and a
minor version number results in minor versions that are `NaN`. In that
situation, since the picker will link to the latest docs in the
major version, include the version in the version picker.

Fixes: #23979
PR-URL: #24638
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants