ontainer.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;
    tabPanes.forEach(tabPane => {
      const match = tabPane.id.match(/^tabset-(\d+)/);
      if (match) {
        const number = parseInt(match[1], 10);
        if (number > maxTabsetNumber) {
          maxTabsetNumber = number;
        }
      }
    });
    return maxTabsetNum