-
Notifications
You must be signed in to change notification settings - Fork 321
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
FIX: Add anchor offset for <dt> anchor links #280
Conversation
I think you might have a merge resolution leftover in your code :-) though I think the fix does work! |
@@ -17,6 +17,7 @@ | |||
|
|||
{% macro head_pre_bootstrap() %} | |||
<link href="{{ pathto('_static/css/theme.css', 1) }}" rel="stylesheet" /> | |||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yeah - looks like you need to resolve this merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah darn, thought the yarn build
solved this. Cleared the merge conflicts, ran yarn build
again...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have learned to always ignore merge conflicts in this auto-generated file, but just let the build regereate it ..
@hoetmaaiers thanks for looking into this! Checking the demo docs, the link is now working correctly, but it seems to have some undesired side effects on the rest of the layout .. |
It seems that the |
This is indeed a strong issue. I assume we want to keep the highlighted box since this adds some good user experience. By wrapping the dt content in an extra div (e.g. <dt id="numpy.linalg.matrix_power">
<div class="dt-content">
<code class="sig-prename descclassname">numpy.linalg.</code>
<code class="sig-name descname">matrix_power</code>
<span class="sig-paren">(</span>
<em class="sig-param">
<span class="n">a</span>
</em>,
<em class="sig-param">
<span class="n">n</span>
</em>
<span class="sig-paren">)</span>
<a class="headerlink" href="#numpy.linalg.matrix_power" title="Permalink to this definition">¶</a>
</div>
</dt> |
Hmm, actually I am not sure it is that important. At least for doc sites like pandas, where each docstring gets its own page, I don't think it adds much value. But indeed, for pages with many docstrings under each other on a single page, highlighting the linked one can be useful.
Unfortunately, I don't think this is that easy to modify the generated html (I would need to look into sphinx' autodoc extension and the directive it uses). We might be able to add a class if we override that similarly as we do for table: https://github.com/pandas-dev/pydata-sphinx-theme/blob/edc2a0bdee1411ac9f7d5950fcacb4720a7134e0/pydata_sphinx_theme/bootstrap_html_translator.py#L23, but would need to look into it to know. |
After some more thinking (and after a good nights rest), I solved the problem by being more specific in the css selector for |
Cool, that's an easier solution, thanks! One other question, but can be as a follow-up if needed: now we have two places in the scss code that defines very similar styling for a |
Cool, now I learned about |
This fixes #267