Skip to content

Make the sidebar in the documentation follow the section automatically #72231

Closed

Description

@batiste
mannequin
BPO 28044
Nosy @bitdancer, @batiste, @Mariatta
Files
  • following-sidebar.patch
  • following-sidebar-2.patch
  • following-sidebar-3.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2018-08-08.02:50:23.561>
    created_at = <Date 2016-09-09.12:22:07.781>
    labels = ['type-feature', 'docs']
    title = 'Make the sidebar in the documentation follow the section automatically'
    updated_at = <Date 2018-08-08.03:08:32.198>
    user = 'https://github.com/batiste'

    bugs.python.org fields:

    activity = <Date 2018-08-08.03:08:32.198>
    actor = 'Mariatta'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2018-08-08.02:50:23.561>
    closer = 'Mariatta'
    components = ['Documentation']
    creation = <Date 2016-09-09.12:22:07.781>
    creator = 'batiste'
    dependencies = []
    files = ['44502', '44590', '44591']
    hgrepos = []
    issue_num = 28044
    keywords = ['patch']
    message_count = 11.0
    messages = ['275315', '275321', '275345', '275350', '275990', '275993', '275999', '323257', '323258', '323259', '323260']
    nosy_count = 6.0
    nosy_names = ['v+python', 'r.david.murray', 'SilentGhost', 'docs@python', 'batiste', 'Mariatta']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue28044'
    versions = ['Python 3.5', 'Python 3.6']

    Activity

    1. batiste commented on Sep 9, 2016

      batistemannequin
      MannequinAuthor

      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.

    2. added
      docsDocumentation in the Doc dir
      type-featureA feature request or enhancement
      on Sep 9, 2016
    3. SilentGhost commented on Sep 9, 2016

      SilentGhostmannequin
      Mannequin

      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.

    4. bitdancer commented on Sep 9, 2016

      @bitdancer
      Member

      -1. I don't like sites that do this, and don't want ours to be one of them.

    5. bitdancer commented on Sep 9, 2016

      @bitdancer
      Member

      But thanks for the interest and writing the patch. Others may disagree with me and it may go in anyway :)

    6. batiste commented on Sep 12, 2016

      batistemannequin
      MannequinAuthor

      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
    7. batiste commented on Sep 12, 2016

      batistemannequin
      MannequinAuthor

      Minor typo fix.

    8. batiste commented on Sep 12, 2016

      batistemannequin
      MannequinAuthor

      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.

    9. vpython commented on Aug 8, 2018

      vpythonmannequin
      Mannequin

      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.

    10. Mariatta commented on Aug 8, 2018

      @Mariatta
      Member

      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.

    11. vpython commented on Aug 8, 2018

      vpythonmannequin
      Mannequin

      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?

    12. Mariatta commented on Aug 8, 2018

      @Mariatta
      Member

      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.

    13. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      docsDocumentation in the Doc dirtype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions