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

Read the Docs: show version warning #4549

Open
hugovk opened this issue Apr 12, 2020 · 3 comments
Open

Read the Docs: show version warning #4549

hugovk opened this issue Apr 12, 2020 · 3 comments
Labels

Comments

@hugovk
Copy link
Member

@hugovk hugovk commented Apr 12, 2020

Sometimes people read/link to old versions of the documentation and miss new features and changes.

For example, from a Google search for a module, I ended up at http://pillow.readthedocs.org/en/3.1.x/reference/ImageChops.html

RtD has a setting to help with this:

Version warning

This is a banner that appears on the top of every page of your docs that aren’t stable or latest. This banner has a text with a link redirecting the users to the latest version of your docs.

This feature is disabled by default on new projects, you can enable it in the admin section of your docs (Admin > Advanced Settings).

https://docs.readthedocs.io/en/stable/versions.html#version-warning

However this is enabled at https://readthedocs.org/dashboard/pillow/advanced/ and there's no banner shown for 3.1.x above.

Let's find out why and fix it.

@nulano
Copy link
Contributor

@nulano nulano commented Apr 12, 2020

Under https://readthedocs.org/projects/pillow/versions/ I only see latest and stable. Perhaps this should contain a list of all versions?

Trying various urls randomly, I can also see 3.0.x docs with a green version number in the bottom left (same as 3.1.x). If I try 4.0.x, 4.1.x, 4.2.x, 5.1.x it also shows docs for that version, but with a red banner in the bottom left. 7.0.x and 7.1.x don't work at all (404 error).

@hugovk
Copy link
Member Author

@hugovk hugovk commented Apr 12, 2020

As a maintainer I see a list of the other versions:

No obvious difference there between 3.0.x, 4.0.x or 7.0.x., etc.

@radarhere
Copy link
Member

@radarhere radarhere commented Apr 12, 2020

In the middle of https://assets.readthedocs.org/static/javascript/readthedocs-doc-embed.js, there is

t.is_sphinx_builder()&&t.is_rtd_like_theme()?$("div.rst-other-versions").html(e.html):$("body").append(e.html)

This makes me think that for our theme, the lower left red banner is the 'banner that appears on the top of every page'.

Note that we are already injecting content into the theme, so if we wanted, we could customise it further.

app.add_js_file("js/script.js")

For 3.0.x and 3.1.x, where we don't have the red in the lower left, there is a console error, 'Error loading Read the Docs footer'. This is presumably caused by a 404 from an API GET request, which in turn is caused by a double slash in the API URL. However, 3.2.x does have the red in the lower left.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.