// add classes for code-block-filename styling $('.rst-content pre') .prev('blockquote') .addClass('code-block-filename'); var tabConversionIterations = 0 // convert tab admonition to tabs while (true) { const firstTab = $('.rst-content .admonition.tab').first() if (firstTab.length == 0) break; const otherTabs = firstTab.nextUntil(':not(.admonition.tab)'); const allTabs = $($.merge($.merge([], firstTab), otherTabs)); const tabContainer = $('
').addClass('tabs'); const headerContainer = $('
').addClass('tabs-header'); const contentContainer = $('
').addClass('tabs-content'); tabContainer.insertBefore(firstTab); tabContainer.append(headerContainer, contentContainer) const selectTab = function (index) { headerContainer.children().removeClass('active') headerContainer.children().eq(index).addClass('active') contentContainer.children().hide() contentContainer.children().eq(index).show() } allTabs.each(function (tabI, el) { const $el = $(el) const titleElement = $el.children('.admonition-title') const title = titleElement.text() const button = $('