This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Make the sidebar in the documentation follow the section automatically
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Mariatta, SilentGhost, batiste, docs@python, r.david.murray, v+python
Priority: normal Keywords: patch

Created on 2016-09-09 12:22 by batiste, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
following-sidebar.patch batiste, 2016-09-09 12:22
following-sidebar-2.patch batiste, 2016-09-12 08:04
following-sidebar-3.patch batiste, 2016-09-12 08:19
Messages (11)
msg275315 - (view) Author: Batiste (batiste) * Date: 2016-09-09 12:22
Hi,

Here is a small patch for the documentation that make the sidebar follow the headers while scrolling through a long page.

http://imgur.com/UsrFAti

Test on Chrome and Firefox. Seems to work like a charm.
msg275321 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-09-09 15:54
I get the following warning in Firefox's Developer console: 

This site appears to use a scroll-linked positioning effect. This may not work well with asynchronous panning; see https://developer.mozilla.org/docs/Mozilla/Performance/ScrollLinkedEffects for further details and to join the discussion on related tools and features!

It would also be good to clear up a patch a little bit: the first chunk in sidebar.js seems spurious, the '.headerlink .headerlink' selector also looks odd. The nested menu items (e.g. in os.html) seem to confuse your code and make navigation non-functional.
msg275345 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-09-09 16:53
-1.  I don't like sites that do this, and don't want ours to be one of them.
msg275350 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-09-09 17:00
But thanks for the interest and writing the patch.  Others may disagree with me and it may go in anyway :)
msg275990 - (view) Author: Batiste (batiste) * Date: 2016-09-12 08:04
Here is a second patch which is improved in some ways:

1. removed the '.headerlink .headerlink'
2. when scrolling over the side bar the 'snappin' is disabled therefor it is rather easy to search and find the desired section or the search box
3. removed an error when collapsing the menu
4. Scrolling all the way down with a small viewport doesn't push the sidebar over the footer
msg275993 - (view) Author: Batiste (batiste) * Date: 2016-09-12 08:19
Minor typo fix.
msg275999 - (view) Author: Batiste (batiste) * Date: 2016-09-12 08:36
So answer to your comments SilentGhost:

I had a look at what Mozilla recommend. Their proposition of using position:sticky is interesting and probably possible for this use case but might require quite a bit of extra work. There is also the other suggestion to use something like https://lodash.com/docs/4.15.0#debounce but that would mean more jumpy animations but less computation. Also there is this http://caniuse.com/#feat=css-snappoints that would solve the issue created just before but it is not well supported yet.

All in all interesting points.

Off course I am willing to spend some time on optimization this if necessary. But before that I might want to have some kind of "approval" that my work as a chance to be used.

And I have a question for you R. David Murray. Look here for example:

https://docs.python.org/3/library/asyncio-protocol.html#udp-echo-server-protocol

What is the value of having an empty left sidebar here? Shoudn't we remove the sidebar completly if you have to scroll all the way up anyway? I don't really see the value for this sidebar in many of the long pages Python documentation offers.
msg323257 - (view) Author: Glenn Linderman (v+python) * Date: 2018-08-08 02:35
Nice implementation of sticky sidebar.
https://css-tricks.com/sticky-smooth-active-nav/#more-273952

I haven't looked at the patch, and don't know what R. David Murray doesn't like about how it works, but I find the Python sidebar extremely annoying because it scrolls off the top, and would rather it stayed around visible.
msg323258 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2018-08-08 02:50
Really sorry, but this issue is now out of date, and the patch no longer applies.

The Python documentation theme is now being tracked in https://github.com/python/python-docs-theme/

Perhaps bring up this issue there?

Thanks.
msg323259 - (view) Author: Glenn Linderman (v+python) * Date: 2018-08-08 02:58
Uh, thanks, I guess, but it wasn't marked out of date or resolved or closed when I commented. I haven't used the GitHub issue tracker. Sigh. There should be a link here to the issue that was copied there, to make it easy and obvious?
msg323260 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2018-08-08 03:08
You can file a new issue in https://github.com/python/python-docs-theme/ and just add a link to this issue from GitHub in the description.
History
Date User Action Args
2022-04-11 14:58:36adminsetgithub: 72231
2018-09-25 11:55:49xtreaklinkissue33442 superseder
2018-08-10 21:56:18Mariattalinkissue34378 superseder
2018-08-08 03:08:32Mariattasetnosy: + Mariatta
messages: + msg323260
2018-08-08 02:58:08v+pythonsetnosy: - Mariatta
messages: + msg323259
2018-08-08 02:50:23Mariattasetstatus: open -> closed

nosy: + Mariatta
messages: + msg323258

resolution: out of date
stage: needs patch -> resolved
2018-08-08 02:35:47v+pythonsetnosy: + v+python
messages: + msg323257
2016-09-12 08:36:44batistesetmessages: + msg275999
2016-09-12 08:19:52batistesetfiles: + following-sidebar-3.patch

messages: + msg275993
2016-09-12 08:04:03batistesetfiles: + following-sidebar-2.patch

messages: + msg275990
2016-09-09 17:00:02r.david.murraysetmessages: + msg275350
2016-09-09 16:53:46r.david.murraysetnosy: + r.david.murray
messages: + msg275345
2016-09-09 15:54:05SilentGhostsetversions: + Python 3.5, Python 3.6
nosy: + SilentGhost

messages: + msg275321

stage: needs patch
2016-09-09 12:22:07batistecreate