Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anchor links hidden by header navbar #267

Closed
polwel opened this issue Oct 7, 2020 · 6 comments · Fixed by #280
Closed

anchor links hidden by header navbar #267

polwel opened this issue Oct 7, 2020 · 6 comments · Fixed by #280

Comments

@polwel
Copy link

polwel commented Oct 7, 2020

This issue is very similar to #258, but I observe it with the vanilla CSS.

Here is a MWE sphinx environment. Freshly out of sphinx-quickstart, except the theme in conf.py, and some dummy content.
test.zip

Browsing to index.html#send_message3 hides the section header under the navbar. Tested on Chrome and Firefox. Happens regardless of browser window size.
image

pydata-sphinx-theme           0.4.1
Sphinx                        3.2.1

I am on Windows, Python 3.8.5 AMD64.

@polwel
Copy link
Author

polwel commented Oct 10, 2020

FWIW, the issue is also noticeable in the live pandas docs:
https://pandas.pydata.org/docs/reference/api/pandas.read_table.html#pandas.read_table

@jorisvandenbossche
Copy link
Member

Thanks for the report!

It's strange that this anchor (from clicking on the ¶ on the page) actually works: https://pandas.pydata.org/docs/reference/api/pandas.read_table.html#pandas-read-table. But sphinx uses the link you posted in the autosummary tables

@jorisvandenbossche
Copy link
Member

So the difference is that the one is linking to the div around the header (<div class="section" id="pandas-read-table">), while the other one is linking to the id of the description list (<dt id="pandas.read_table">), for which we don't correct with an offset. Since links in general can point to other things than headers, we should probably have a more general fix for this problem.

@jorisvandenbossche
Copy link
Member

@hoetmaaiers for reference, the link we talked about last week which shows the same issue in the demo docs is one of the links in the table at https://pydata-sphinx-theme.readthedocs.io/en/latest/demo/api.html#autosummary-table-and-api-stub-pages.
(so eg https://pydata-sphinx-theme.readthedocs.io/en/latest/demo/generated/pandas.DataFrame.drop.html#pandas.DataFrame.drop for the first entry)

@jorisvandenbossche
Copy link
Member

Another example in the pandas docs is this link: https://pandas.pydata.org/docs/dev/user_guide/io.html#io-navaluesconst
It actually points to the sentence "The default NaN recognized values are ...", which is under the nabar when clicking the link above

@polwel
Copy link
Author

polwel commented Feb 4, 2021

Thanks for looking into this. I sort of lost track of it.

Unfortunately, the original example I posted still fails in the same way. AFAICT, the PR should be in the current release, right?

Tested with:

pydata-sphinx-theme           0.4.3
Sphinx                        3.4.3

Let me know if you need more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants