JuliaPluto / PlutoUI.jl

https://featured.plutojl.org/basic/plutoui.jl
The Unlicense
302 stars 55 forks source link

Make TableOfContents headers go to top of screen #171

Closed MasonProtter closed 2 years ago

MasonProtter commented 2 years ago

Before this change, if you clicked on a heading in the TableOfContents, the page would navigate so that the selected heading was in the centre of the screen, which is a very behaviour and I find very difficult to adjust to. E.g. compare to how table of contents work in Wikipedia.

Currently, when one clicks on the heading "Level 2" this is what you see. image This makes it quite difficult for the eye to quickly locate level 2 on the screen!

With this PR, you now instead see image

which is much easier to locate, because it's quite easy for the eye to estimate where the top of the page is, but not the middle (unless you have a guide rule across your screen).

github-actions[bot] commented 2 years ago

Try this Pull Request!

Open Julia and type:

  julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/MasonProtter/PlutoUI.jl", rev="patch-1")
julia> using PlutoUI

Or run this code in your browser: Run with binder

fonsp commented 2 years ago

Thanks!