djangoproject.com
djangoproject.com copied to clipboard
The dev warning at the top of docs pages covers anchor titles
Fixed in 38ffd6faf52e66332abbc20a224ab444b09471c1.
I can confirm that visiting a permalink pointing to a specific section in the docs (or clicking on its permalink symbol) now scrolls the page enough for the section's title to be viewable.
However, editing the url in the address manually then pressing enter to jump to a section still results in the same bug. The same happens even if you press enter in the address bar without any manual editing, provided of course the url points to a section.
Hm, yeah, the code doing that is a bit janky anyways.. lemme see.
@pkatseas Can you check again?
@jezdez Fixed indeed when the hash changes. :+1:
Unfortunately, as I mentioned this also happens when you just revisit the same hash location, and that doesn't seem to be fixed yet. Kind of an edge case I suppose, anyway.
Sigh, still seeing it somethings, yeah.
Something like this could be a reliable CSS fix, no JS required:
.section > span[id]:first-child { padding-top: 38px; }
I guess it would be more like this now, reflecting recent changes in the markup:
.section > span:first-child + span[id] { padding-top: 38px; }
But you get the idea. Can has? :D
...and now it'd be more like this again...
.section > span:first-child[id] { padding-top: 38px; }
- ~Why is this code so volatile?~ This code should not be so volatile.
- Can this please get resolved?
You're welcome to submit a pull request. With your change, would the JavaScript be removed?
Well, I would definitely like to be able to test it all so it's perfect, but after going through all the stuff in the README.rst and downloading over a gigabyte (& it's still going), I've decided it's definitely not worth it.
Anyway, it's literally only this bit of CSS (at this particular moment [you guys keep changing the HTML/hierarchy constantly, or it is otherwise inconsistent between pages/sections])...
.section > span:first-child + span[id] { padding-top: 38px; }
...where padding-top: 38px
should simply match the height of the colored bar at the top, and be applied to whatever meaningless extraneous empty span you're apply the id
attribute to at the moment instead of applying it to the h#
element where it should be.
No JavaScript would be required after using this CSS to correct any vertical orientation due to the colored bar at the top (and it would also always work for any situation, instead of only working sometimes).
I guess all that downloading is coming from update_docs
? We might consider trimming the djangoproject.com/docs/fixtures/doc_releases.json
file as there's usually no need for someone to build all those documentation versions. You can go into the admin and delete the extras.
I removed unneeded doc releases in 79edf27bd63a89c982d1369cd5e27d7b9699154a.
This issue doesn't now reproduce for me on Safari or Firefox.