class for styling
      const tocLink = document.createElement("a");
      tocLink.href = `#${header.id}`;
      tocLink.textContent = toTitleCase(header.textContent); // Convert to title case
      tocItem.appendChild(tocLink);
      tocList.appendChild(tocItem);
    });

    tocContainer.appendChild(tocList);
  }

  // Gets the highest number of the layer of the tabsets
  function getMaxTabsetNumber() {
    const tabPanes = document.querySelectorAll('.tab-pane[id^="tabset-"]');
    let maxTabsetNumber = 1