Skip to content

Commit

Permalink
fix: Fix rendering when clicking on hidden toc entries
Browse files Browse the repository at this point in the history
Issue: #60
  • Loading branch information
pawamoy committed Sep 28, 2020
1 parent 6429460 commit 2af4d31
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 20 deletions.
10 changes: 2 additions & 8 deletions docs/css/mkdocstrings.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@ h5.doc-heading {
text-transform: none !important;
}

h6.hidden-toc {
margin: 0 !important;
position: relative;
top: -70px;
}

h6.hidden-toc::before {
.hidden-toc::before {
margin-top: 0 !important;
padding-top: 0 !important;
}

h6.hidden-toc a.headerlink {
.hidden-toc a.headerlink {
display: none;
}

Expand Down
9 changes: 2 additions & 7 deletions docs/handlers/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,18 +304,13 @@ h5.doc-heading {
}
/* Don't use vertical space on hidden ToC entries. */
h6.hidden-toc {
margin: 0 !important;
position: relative;
top: -70px;
}
h6.hidden-toc::before {
.hidden-toc::before {
margin-top: 0 !important;
padding-top: 0 !important;
}
/* Don't show permalink of hidden ToC entries. */
h6.hidden-toc a.headerlink {
.hidden-toc a.headerlink {
display: none;
}
Expand Down
2 changes: 1 addition & 1 deletion src/mkdocstrings/templates/python/material/attribute.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
href="#{{ attribute.path }}"
id="{{ attribute.path }}"
data-toc-label="{{ attribute.path }}"
style="visibility: hidden; width: 0; height: 0;">
style="visibility: hidden; position: absolute;">
</h{{ heading_level }}>
{% endif %}
{% set heading_level = heading_level - 1 %}
Expand Down
2 changes: 1 addition & 1 deletion src/mkdocstrings/templates/python/material/class.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
href="#{{ class.path }}"
id="{{ class.path }}"
data-toc-label="{{ class.path }}"
style="visibility: hidden; width: 0; height: 0;">
style="visibility: hidden; position: absolute;">
</h{{ heading_level }}>
{% endif %}
{% set heading_level = heading_level - 1 %}
Expand Down
2 changes: 1 addition & 1 deletion src/mkdocstrings/templates/python/material/function.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
href="#{{ function.path }}"
id="{{ function.path }}"
data-toc-label="{{ function.path }}"
style="visibility: hidden; width: 0; height: 0;">
style="visibility: hidden; position: absolute;">
</h{{ heading_level }}>
{% endif %}
{% set heading_level = heading_level - 1 %}
Expand Down
2 changes: 1 addition & 1 deletion src/mkdocstrings/templates/python/material/method.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
href="#{{ method.path }}"
id="{{ method.path }}"
data-toc-label="{{ method.path }}"
style="visibility: hidden; width: 0; height: 0;">
style="visibility: hidden; position: absolute;">
</h{{ heading_level }}>
{% endif %}
{% set heading_level = heading_level - 1 %}
Expand Down
2 changes: 1 addition & 1 deletion src/mkdocstrings/templates/python/material/module.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
href="#{{ module.path }}"
id="{{ module.path }}"
data-toc-label="{{ module.path }}"
style="visibility: hidden; width: 0; height: 0;">
style="visibility: hidden; position: absolute;">
</h{{ heading_level }}>
{% endif %}
{% set heading_level = heading_level - 1 %}
Expand Down

0 comments on commit 2af4d31

Please sign in to comment.