-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Turing's navbar from MCMCDiagnosticTools page
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Remove the Turing navigation menu from the documentation pages, | ||
// if present. Tested against the navbar code defined in | ||
// https://github.com/TuringLang/turinglang.github.io/blob/3e4f5900d90e014a939867e3fe1ac256bdd37f14/assets/scripts/TuringNavbar.html | ||
document.addEventListener("DOMContentLoaded", function () { | ||
var navElement = document.querySelector('nav.ext-navigation'); | ||
if (navElement) { | ||
// Remove the <style> tag before the <nav> element | ||
var prevElement = navElement.previousElementSibling; | ||
if (prevElement && prevElement.tagName.toLowerCase() === 'style') { | ||
prevElement.parentNode.removeChild(prevElement); | ||
} | ||
|
||
// Remove the <nav> element | ||
navElement.parentNode.removeChild(navElement); | ||
|
||
// Remove the <script> tag after the <nav> element | ||
var nextElement = navElement.nextElementSibling; | ||
if (nextElement && nextElement.tagName.toLowerCase() === 'script') { | ||
nextElement.parentNode.removeChild(nextElement); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters