|
| 1 | +<h3><a href="{{ pathto(root_doc)|e }}">{{ project|title }}</a></h3> |
| 2 | +<div id="salt-globaltoc"> |
| 3 | +{{ toctree(includehidden=True, collapse=False, maxdepth=1) }} |
| 4 | +</div> |
| 5 | + |
| 6 | +<style> |
| 7 | +#salt-globaltoc { |
| 8 | + font-size: 0.875rem; |
| 9 | +} |
| 10 | + |
| 11 | +#salt-globaltoc ul { |
| 12 | + list-style: none; |
| 13 | + padding: 0; |
| 14 | + margin: 0 0 0.25rem 0; |
| 15 | +} |
| 16 | + |
| 17 | +#salt-globaltoc p.caption { |
| 18 | + display: flex; |
| 19 | + align-items: center; |
| 20 | + gap: 0.4em; |
| 21 | + cursor: pointer; |
| 22 | + font-size: 0.75rem; |
| 23 | + font-weight: 700; |
| 24 | + text-transform: uppercase; |
| 25 | + letter-spacing: 0.08em; |
| 26 | + color: var(--pst-color-text-muted, #6c757d); |
| 27 | + padding: 0.35rem 0.25rem 0.35rem 0; |
| 28 | + margin: 0.75rem 0 0 0; |
| 29 | + user-select: none; |
| 30 | +} |
| 31 | + |
| 32 | +#salt-globaltoc p.caption:hover { |
| 33 | + color: var(--pst-color-text-base, inherit); |
| 34 | +} |
| 35 | + |
| 36 | +/* Triangle arrow indicator */ |
| 37 | +#salt-globaltoc p.caption::before { |
| 38 | + content: ""; |
| 39 | + display: inline-block; |
| 40 | + flex-shrink: 0; |
| 41 | + width: 0; |
| 42 | + height: 0; |
| 43 | + border-style: solid; |
| 44 | + border-width: 4px 0 4px 6px; |
| 45 | + border-color: transparent transparent transparent currentColor; |
| 46 | + transition: transform 0.15s ease; |
| 47 | +} |
| 48 | + |
| 49 | +#salt-globaltoc p.caption.expanded::before { |
| 50 | + transform: rotate(90deg); |
| 51 | +} |
| 52 | + |
| 53 | +#salt-globaltoc .toctree-l1 > a { |
| 54 | + display: block; |
| 55 | + padding: 0.25rem 0.5rem; |
| 56 | + color: var(--pst-color-text-base, inherit); |
| 57 | + text-decoration: none; |
| 58 | + border-radius: 4px; |
| 59 | + line-height: 1.4; |
| 60 | +} |
| 61 | + |
| 62 | +#salt-globaltoc .toctree-l1 > a:hover { |
| 63 | + background-color: var(--pst-color-surface, rgba(0, 0, 0, 0.06)); |
| 64 | +} |
| 65 | + |
| 66 | +#salt-globaltoc .toctree-l1.current > a, |
| 67 | +#salt-globaltoc .toctree-l1.current > a:hover { |
| 68 | + font-weight: 600; |
| 69 | + background-color: var(--pst-color-surface, rgba(0, 0, 0, 0.06)); |
| 70 | + color: var(--pst-color-primary, #0099cd); |
| 71 | +} |
| 72 | +</style> |
| 73 | + |
| 74 | +<script> |
| 75 | +(function () { |
| 76 | + function initCollapsible() { |
| 77 | + var container = document.getElementById("salt-globaltoc"); |
| 78 | + if (!container) return; |
| 79 | + |
| 80 | + container.querySelectorAll("p.caption").forEach(function (caption) { |
| 81 | + var ul = caption.nextElementSibling; |
| 82 | + if (!ul || ul.tagName !== "UL") return; |
| 83 | + |
| 84 | + if (ul.querySelector("li.current")) { |
| 85 | + caption.classList.add("expanded"); |
| 86 | + } else { |
| 87 | + ul.style.display = "none"; |
| 88 | + } |
| 89 | + |
| 90 | + caption.addEventListener("click", function () { |
| 91 | + var isCollapsed = ul.style.display === "none"; |
| 92 | + ul.style.display = isCollapsed ? "" : "none"; |
| 93 | + caption.classList.toggle("expanded", isCollapsed); |
| 94 | + }); |
| 95 | + }); |
| 96 | + } |
| 97 | + |
| 98 | + if (document.readyState === "loading") { |
| 99 | + document.addEventListener("DOMContentLoaded", initCollapsible); |
| 100 | + } else { |
| 101 | + initCollapsible(); |
| 102 | + } |
| 103 | +})(); |
| 104 | +</script> |
0 commit comments