From d53c96760ae932615673078ec6315cc52ddd57ad Mon Sep 17 00:00:00 2001 From: patnr Date: Mon, 4 Nov 2024 18:33:56 +0100 Subject: [PATCH] Rm sidebar in Jupyter notebook for wider content area --- docs/javascripts/extra.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/javascripts/extra.js b/docs/javascripts/extra.js index 584b3c70..affa2965 100644 --- a/docs/javascripts/extra.js +++ b/docs/javascripts/extra.js @@ -7,3 +7,11 @@ document.addEventListener("DOMContentLoaded", function() { document.body.classList.add('document-is-notebook'); } }); + +// Using the document$ observable from mkdocs-material to get notified of page "reload" also if using `navigation.instant` (SSA) +// https://github.com/danielfrg/mkdocs-jupyter/issues/99#issuecomment-2455307893 +document$.subscribe(function() { + if (document.querySelector('.jp-Notebook')) { + document.querySelector("div.md-sidebar.md-sidebar--primary").remove(); + } +});