[issue28044] Make the sidebar in the documentation follow the section automatically
New submission from Batiste: 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. ---------- assignee: docs@python components: Documentation files: following-sidebar.patch keywords: patch messages: 275315 nosy: batiste, docs@python priority: normal severity: normal status: open title: Make the sidebar in the documentation follow the section automatically type: enhancement Added file: http://bugs.python.org/file44502/following-sidebar.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28044> _______________________________________
SilentGhost added the comment: 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. ---------- nosy: +SilentGhost stage: -> needs patch versions: +Python 3.5, Python 3.6 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28044> _______________________________________
R. David Murray added the comment: -1. I don't like sites that do this, and don't want ours to be one of them. ---------- nosy: +r.david.murray _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28044> _______________________________________
R. David Murray added the comment: But thanks for the interest and writing the patch. Others may disagree with me and it may go in anyway :) ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28044> _______________________________________
Batiste added the comment: 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 ---------- Added file: http://bugs.python.org/file44590/following-sidebar-2.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28044> _______________________________________
Batiste added the comment: Minor typo fix. ---------- Added file: http://bugs.python.org/file44591/following-sidebar-3.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28044> _______________________________________
Batiste added the comment: 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-prot... 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. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28044> _______________________________________
Glenn Linderman <v+python@g.nevcal.com> added the comment: 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. ---------- nosy: +v+python _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue28044> _______________________________________
Mariatta Wijaya <mariatta.wijaya@gmail.com> added the comment: 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. ---------- nosy: +Mariatta resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue28044> _______________________________________
Glenn Linderman <v+python@g.nevcal.com> added the comment: 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? ---------- nosy: -Mariatta _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue28044> _______________________________________
Mariatta Wijaya <mariatta.wijaya@gmail.com> added the comment: 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. ---------- nosy: +Mariatta _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue28044> _______________________________________
participants (5)
-
Batiste
-
Glenn Linderman
-
Mariatta Wijaya
-
R. David Murray
-
SilentGhost