()
| 342 | // ── Main ────────────────────────────────────────────────────────────────── |
| 343 | |
| 344 | function initPage() { |
| 345 | if (!window.location.pathname.includes(LOG_REFERENCE_PATH)) return; |
| 346 | |
| 347 | // Support both Material MkDocs (.md-content) and mdBook (#content) |
| 348 | const content = document.querySelector(".md-content, #content"); |
| 349 | if (!content) return; |
| 350 | |
| 351 | // 1. Version banner |
| 352 | injectVersionBanner(content); |
| 353 | |
| 354 | // 2. Color inline level badges everywhere on the page |
| 355 | colorLevelBadges(content); |
| 356 | |
| 357 | // 3. Inject GitHub links into File column cells |
| 358 | linkifyFileCells(content); |
| 359 | |
| 360 | // 4. Insert one control block per domain section |
| 361 | getDomainSections(content).forEach(({ heading, tables }) => { |
| 362 | if (!tables.length) return; |
| 363 | if (heading.dataset.logFilter === "true") return; |
| 364 | heading.dataset.logFilter = "true"; |
| 365 | |
| 366 | const controls = buildDomainControls(tables); |
| 367 | // Insert after the h2 element |
| 368 | heading.insertAdjacentElement("afterend", controls); |
| 369 | }); |
| 370 | } |
| 371 | |
| 372 | // Material instant navigation hook |
| 373 | if (typeof document$ !== "undefined") { |
nothing calls this directly
no test coverage detected