diff --git a/docs/javascripts/platform-tab-toc.js b/docs/javascripts/platform-tab-toc.js new file mode 100644 index 0000000..90e763e --- /dev/null +++ b/docs/javascripts/platform-tab-toc.js @@ -0,0 +1,56 @@ +// Tag right-hand TOC links with the platform tab that owns their heading, +// then mirror the active tab onto
so CSS can +// fade out the inactive tab's TOC entries. Used by docs/tutorials/system_configuration.md. + +(function () { + function apply() { + var wrapper = document.querySelector(".platform-tabs > .tabbed-set"); + if (!wrapper) return; + + var blocks = wrapper.querySelectorAll( + ":scope > .tabbed-content > .tabbed-block" + ); + if (blocks.length < 2) return; + + var tabKeys = ["igx-orin", "dgx-spark"]; + + var anchorTab = {}; + blocks.forEach(function (block, i) { + block.querySelectorAll("[id]").forEach(function (el) { + anchorTab["#" + el.id] = tabKeys[i]; + }); + }); + + document + .querySelectorAll(".md-nav--secondary a[href^='#']") + .forEach(function (a) { + var key = anchorTab[a.getAttribute("href")]; + if (key) a.setAttribute("data-tab", key); + }); + + var radios = wrapper.querySelectorAll(":scope > input[type='radio']"); + function syncActive() { + for (var i = 0; i < radios.length; i++) { + if (radios[i].checked) { + document.body.dataset.activeTab = tabKeys[i]; + return; + } + } + } + radios.forEach(function (r) { + r.addEventListener("change", syncActive); + r.addEventListener("input", syncActive); + }); + syncActive(); + } + + if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", apply); + } else { + apply(); + } + + if (window.document$ && typeof window.document$.subscribe === "function") { + window.document$.subscribe(apply); + } +})(); diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index b5ce45f..5761281 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -50,3 +50,22 @@ [data-md-color-scheme="slate"] .md-footer { background: #111; } + +/* ── Platform tabs (IGX Orin / DGX Spark) — enlarged labels ────────── */ +/* Scoped to the .platform-tabs wrapper in system_configuration.md and */ +/* limited to the wrapper's direct tabbed-set so nested sub-tabs */ +/* (tune_system.py / manual, One-time / Persistent, …) are unaffected. */ +.md-typeset .platform-tabs > .tabbed-set > .tabbed-labels > label { + font-size: 1rem; + font-weight: 700; + padding: 0.6em 1.2em; +} + +/* ── Right-hand TOC: hide entries that belong to the inactive platform tab. */ +/* JS (platform-tab-toc.js) tags each [data-tab] link and mirrors the active */ +/* tab onto . We hide the link's containing