functionlayoutTocHeader(title) { var el = '' el += `<div class="widget-header dis-select">` el += `<span class="name">${title || __("meta.toc")}</span>` el += `</div>` return el }
functionlayoutWikiTocHeader(title) { var el = '' el += `${title || __("meta.toc")}` return el }
functionlayoutDocTree(pages) { var el = '' for (let p of pages) { if (p.title == null || p.title.length == 0) { continue } let isActive = '' if (p.path === page.path) { isActive += ' active' } if (proj.pages.length > 0) { let href = url_for(p.path); if (p.is_homepage) { href += '#start' } el += `<a class="link${isActive}" href="${href}">` el += `<span class="toc-text">${p.title}</span>` if (isActive.length > 0) { el += icon('default:bookmark.active') } el += `</a>` } } return el }
functionlayoutDiv(fallback) { if (proj == null) { return'' } if (proj.pages == null || proj.pages.length == 0) { return'' } if (proj.sections == null || proj.sections.length == 0) { return'' } var el = '' let index = 0 for (let sec of proj.sections) { if (sec.pages.length == 0) { continue } if (sec.title?.length > 0 && proj.folding && page.path.startsWith("wiki")) { const sectionIndex = findPageSectionIndex(proj.sections, page.path); if(sectionIndex === index) el +=`<details class="tag-plugin colorful folding" color="black" open><summary><p>` else el +=`<details class="tag-plugin colorful folding" color="black"><summary><p>` el += layoutWikiTocHeader(sec.title) el += `</p></summary>` const docTree = layoutDocTree(sec.pages) if (docTree.trim().length > 0) { el += `<div class=""><p>` el += `<div class="widget-body fs14">${docTree}</div>` el += `</p></div>` } el += `</details>` index++ }else{ el += layoutTocHeader(sec.title) const docTree = layoutDocTree(sec.pages) if (docTree.trim().length > 0) { el += `<div class="widget-body fs14">${docTree}</div>` } }