  // Add "Table of Contents" heading
    const tocHeading = document.createElement("h6");
    tocHeading.textContent = "Table of Contents";
    tocContainer.appendChild(tocHeading);

    // Select only h2 headers, including nested tabsets
    const headers = tabContent.querySelectorAll("h2");
    console.log(`Found ${headers.length} h2 headers`);

    const tocList = document.createElement("ul");
    headers.forEach((header) => {
      console.log(`Header: ${header.textContent}`);
      if (!header.id) {
  