Skip to content

Commit 8b2d4a8

Browse files
committed
fix: fix scroll to headings & remove unnecessary scripts
1 parent a10a198 commit 8b2d4a8

File tree

4 files changed

+6
-35
lines changed

4 files changed

+6
-35
lines changed

docs_theme/main.html

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -198,33 +198,5 @@ <h3 class="modal-title fs-5" id="search_modal_label">
198198
{% for path in config.extra_javascript %}
199199
<script src="{{ path|url }}" defer></script>
200200
{% endfor %}
201-
202-
<script>
203-
var shiftWindow = function () {
204-
scrollBy(0, -50);
205-
};
206-
207-
if (location.hash) shiftWindow();
208-
window.addEventListener("hashchange", shiftWindow);
209-
210-
$(".dropdown-menu").on("click touchstart", function (event) {
211-
event.stopPropagation();
212-
});
213-
214-
// Dynamically force sidenav/dropdown to no higher than browser window
215-
$(".side-nav, .dropdown-menu").css(
216-
"max-height",
217-
window.innerHeight - 130
218-
);
219-
220-
$(function () {
221-
$(window).resize(function () {
222-
$(".side-nav, .dropdown-menu").css(
223-
"max-height",
224-
window.innerHeight - 130
225-
);
226-
});
227-
});
228-
</script>
229201
</body>
230202
</html>

docs_theme/src/js/main.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,4 @@ import "../../node_modules/bootstrap/js/dist/tooltip";
1313

1414
import "../scss/styles.scss";
1515

16-
const codeBlocks = document.querySelectorAll("pre code");
17-
codeBlocks.forEach((block) => {
18-
block.parentElement.classList.add(["prettyprint", "well"]);
19-
});
16+
setupPrettify();

docs_theme/src/scss/styles.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,15 @@ pre code {
105105
}
106106

107107
.body-content {
108-
padding-top: 120px;
108+
padding-top: 70px;
109109
padding-bottom: 70px;
110110
}
111111

112112
.badges {
113113
display: flex;
114114
align-items: center;
115115
justify-content: end;
116+
gap: 8px;
116117
}
117118

118119
.toclink {
@@ -153,7 +154,7 @@ pre code {
153154
}
154155

155156
.prettyprint {
156-
padding: 8px;
157+
padding: 20px;
157158
background-color: #f7f7f9;
158159
border: 1px solid #e1e1e8;
159160
}

mkdocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ watch:
1414
markdown_extensions:
1515
- admonition
1616
- toc:
17-
anchorlink: True
17+
# anchorlink: True
18+
permalink: True
1819

1920
nav:
2021
- Home: 'index.md'

0 commit comments

Comments
 (0)