Skip to content
Snippets Groups Projects
Commit 1c73a0b3 authored by Rok Štular's avatar Rok Štular
Browse files

Merge branch 'integrate-jupyter-patches' into 'main'

chore(deps): Move patches into own package

See merge request !349
parents 1fad10f6 7d2fa2c4
No related branches found
No related tags found
2 merge requests!350Publish configuration changes,!349chore(deps): Move patches into own package
Pipeline #220720 passed
......@@ -13,12 +13,18 @@ sphinx:
# Bibliography style
bibtex_reference_style: author_year
html_js_files:
- https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js
- https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js
patch_config:
enabled-patches:
- scroll
- darkmode
- layout
extra_extensions:
- sphinx_inline_tabs
- sphinx_grasple
- sphinx.ext.imgconverter
- download_link_replacer
- jupyterbook_patches
bibtex_bibfiles:
- _bibliography/references_pd.bib
......
.admonition.toggle-hidden .admonition-title ~ * {
display: none;
}
html[data-theme="dark"] .alert {
--bs-alert-bg: #132119;
--bs-alert-color: #d1e7dd;
}
html[data-theme="dark"] main img:not(.only-dark):not(.dark-light) {
filter: invert(1) hue-rotate(180deg);
}
// Keep track of the scroll position
const NAVIGATION_ELEMENT_CLASS = "bd-sidebar-primary";
document.addEventListener("DOMContentLoaded", () => {
addEventListener("beforeunload", () => {
let elements = document.getElementsByClassName(NAVIGATION_ELEMENT_CLASS);
if (elements.length === 0) {
console.warn("No sidebar found, cannot save scroll position");
return;
}
localStorage.setItem("navigationScrollPosition", elements[0].scrollTop);
});
let elements = document.getElementsByClassName(NAVIGATION_ELEMENT_CLASS);
if (elements.length === 0) {
console.warn("No sidebar found, cannot restore scroll position");
return;
}
let scrollPosition = localStorage.getItem("navigationScrollPosition");
if (scrollPosition == null) {
return;
}
// Convert scroll position into a positive number and apply it
let parsedPosition = Math.abs(scrollPosition);
console.debug(`Restoring scroll position to ${parsedPosition}`);
elements[0].scrollTop = isNaN(parsedPosition) ? 0 : parsedPosition;
});
......@@ -3,4 +3,6 @@ jupyter-book
sphinx-inline-tabs
git+https://github.com/dbalague/sphinx-grasple
jupyterquiz
docutils == 0.17.1
\ No newline at end of file
docutils == 0.17.1
--extra-index-url https://gitlab.tudelft.nl/api/v4/projects/17983/packages/pypi/simple
jupyterbook_patches
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment