djangoproject.com icon indicating copy to clipboard operation
djangoproject.com copied to clipboard

The dev warning at the top of docs pages covers anchor titles

Open pkatseas opened this issue 10 years ago • 13 comments

with

pkatseas avatar Dec 17 '14 15:12 pkatseas

Fixed in 38ffd6faf52e66332abbc20a224ab444b09471c1.

jezdez avatar Dec 18 '14 23:12 jezdez

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.

pkatseas avatar Dec 18 '14 23:12 pkatseas

Hm, yeah, the code doing that is a bit janky anyways.. lemme see.

jezdez avatar Dec 19 '14 00:12 jezdez

@pkatseas Can you check again?

jezdez avatar Dec 19 '14 00:12 jezdez

@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.

pkatseas avatar Dec 19 '14 08:12 pkatseas

Sigh, still seeing it somethings, yeah.

jezdez avatar Dec 22 '14 00:12 jezdez

Something like this could be a reliable CSS fix, no JS required: .section > span[id]:first-child { padding-top: 38px; }

matsaman avatar Jan 26 '17 19:01 matsaman

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

matsaman avatar Mar 20 '17 02:03 matsaman

...and now it'd be more like this again... .section > span:first-child[id] { padding-top: 38px; }

  1. ~Why is this code so volatile?~ This code should not be so volatile.
  2. Can this please get resolved?

matsaman avatar Jul 05 '17 23:07 matsaman

You're welcome to submit a pull request. With your change, would the JavaScript be removed?

timgraham avatar Jul 06 '17 12:07 timgraham

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).

matsaman avatar Jul 10 '17 16:07 matsaman

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.

timgraham avatar Jul 10 '17 16:07 timgraham

I removed unneeded doc releases in 79edf27bd63a89c982d1369cd5e27d7b9699154a.

timgraham avatar Jul 15 '17 13:07 timgraham

This issue doesn't now reproduce for me on Safari or Firefox.

carltongibson avatar Oct 06 '22 08:10 carltongibson