-
Notifications
You must be signed in to change notification settings - Fork 1.3k
More visible warning on old version docs pages #3022
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
Comments
I use the Django docs somewhat frequently as well and tend to overlook the warning less. Here is an example of their out of date pages: https://docs.djangoproject.com/en/2.1/ The warning is a top bar and it stays with the user as they scroll. |
@sommersoft Any idea about how to implement this? |
This is not hard to do in CSS, something like: position: fixed; /* Set to fixed position */
top: 0; /* Position at the top of the page */
} |
I actually tried that in developer mode (with That box is inserted by RTD's rendering, so without a good way to CSS it, there's not much to do. I peeked in the RTD docs, and it's barely mentioned that this happens, and there is nothing really beyond that. https://docs.readthedocs.io/en/stable/versions.html#version-warning |
I'm not sure I fully understand how Sphinx and Read the Docs work together to create the docs pages (or if there are other components at work). So perhaps I am overlooking something. It looks like there is support for custom js code: https://docs.readthedocs.io/en/stable/guides/adding-custom-css.html It would be ideal if that warning already had a unique id or class to target with a CSS rule. But since it doesn't maybe it's possible to use custom JS code to find the version warning box based on it's contents and then add an id or class to it. |
I actually just found out why setting the Disabling I can at least select the only box we're worried about with the proper CSS selector: .document > .admonition {
position: sticky;
top: 0px;
} |
This invocation produces fairly good results for me on Chrome: .document > .admonition {
position: sticky;
top: 0px;
background-color: salmon;
z-index: 2;
}
body {
overflow-x: unset!important;
} 4.x and earlier don't seem to call the |
hierophect asked in the discord about a way to hide the notification if it is made sticky. I agree that we should try provide a way to do that if possible. Here is a bit of Javascript that will hide the notification when it gets clicked on: $(".document > .admonition").click(function(){$(this).hide()}); I tested in with the browser console on the live docs page and it seems to be working. Clicking on the latest version link does fire this listener and hide the box, but it does not interfere with being taken to the next page. If we wanted we could target a smaller zone for click-ability like just the title bar, or add an X in the corner. |
So, this has been already solved? should this issue be closed? |
Yup! Thank you @simontorres |
On the older version docs pages such as this one: https://circuitpython.readthedocs.io/en/4.x/shared-bindings/displayio/Group.html
There is a warning at the top and center but I find it somewhat easy to overlook when I arrive on a docs page from a google search or other link.
The two ideas for improvement I had were to make the warning a bolder color and/or make it scroll with the page so it's always visible.
The text was updated successfully, but these errors were encountered: