diff --git a/pages/documentation/index.vue b/pages/documentation/index.vue index f2fce5e..cb9c900 100644 --- a/pages/documentation/index.vue +++ b/pages/documentation/index.vue @@ -39,8 +39,8 @@ renderer.heading = function (text, level, raw) { }; // Custom link renderer for internal .md links renderer.link = function (href, title, text) { - if (href && String(href).endsWith('.md')) { - const file = String(href).split('/').pop(); + if (href && String(href).endsWith(".md")) { + const file = String(href).split("/").pop(); // Use a special class for delegation return `${text}`; } @@ -71,9 +71,9 @@ onMounted(async () => { .replace(/\{\s*\[native code\]\s*\}/gi, "") .replace(/^\s*\[object.*?\]\s*$/gim, "") .trim(); - + let html = marked.parse(content); - + // Post-process HTML to remove any remaining object references html = html .replace(/\[object Object\]/g, "") @@ -140,8 +140,11 @@ onUnmounted(() => { // Scrollspy for TOC function handleScrollSpy() { - const headings = Array.from(document.querySelectorAll('.prose h2, .prose h3')); - const scrollY = window.scrollY || document.querySelector('.main-content')?.scrollTop || 0; + const headings = Array.from( + document.querySelectorAll(".prose h2, .prose h3") + ); + const scrollY = + window.scrollY || document.querySelector(".main-content")?.scrollTop || 0; let current = null; for (const heading of headings) { const rect = heading.getBoundingClientRect(); @@ -153,30 +156,34 @@ function handleScrollSpy() { } onMounted(() => { - document.querySelector('.main-content')?.addEventListener('scroll', handleScrollSpy); - window.addEventListener('scroll', handleScrollSpy); + document + .querySelector(".main-content") + ?.addEventListener("scroll", handleScrollSpy); + window.addEventListener("scroll", handleScrollSpy); }); onUnmounted(() => { - document.querySelector('.main-content')?.removeEventListener('scroll', handleScrollSpy); - window.removeEventListener('scroll', handleScrollSpy); + document + .querySelector(".main-content") + ?.removeEventListener("scroll", handleScrollSpy); + window.removeEventListener("scroll", handleScrollSpy); }); // Event delegation for .doc-link clicks onMounted(() => { const handler = (e) => { - const target = e.target.closest('.doc-link'); + const target = e.target.closest(".doc-link"); if (target && target.dataset.doc) { e.preventDefault(); e.stopPropagation(); selectDoc(target.dataset.doc); } }; - document.addEventListener('click', handler); + document.addEventListener("click", handler); window.__docLinkHandler = handler; }); onUnmounted(() => { if (window.__docLinkHandler) { - document.removeEventListener('click', window.__docLinkHandler); + document.removeEventListener("click", window.__docLinkHandler); delete window.__docLinkHandler; } }); @@ -367,7 +374,9 @@ watch(selected, () => { - + { - - + + { class="pl-10 pr-4 py-2 w-80 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" /> - + { class="w-80 flex-shrink-0 sticky top-6 h-fit" :class="showMobileSidebar ? 'block' : 'hidden lg:block'" > - + Contents @@ -436,12 +452,16 @@ watch(selected, () => { :key="category" class="mb-6" > - + {{ category }} { > {{ doc.title }} - - {{ doc.readingTime }} min + + {{ doc.readingTime }} min { No results found for "{{ searchQuery }}" @@ -494,7 +520,9 @@ watch(selected, () => { > {{ doc.title }} - {{ doc.readingTime }} min + {{ doc.readingTime }} min @@ -506,17 +534,27 @@ watch(selected, () => { - + - + Loading documentation... - - {{ error }} + + + {{ error }} + Please try refreshing the page @@ -526,7 +564,9 @@ watch(selected, () => { - + {{ selectedDoc.order }} @@ -542,7 +582,10 @@ watch(selected, () => { - + {{ selectedDoc.readingTime }} min read @@ -550,11 +593,26 @@ watch(selected, () => { - + - - + + @@ -572,14 +630,19 @@ watch(selected, () => { - + - + {{ previousDoc.title }} @@ -591,7 +654,10 @@ watch(selected, () => { size="sm" > {{ nextDoc.title }} - + @@ -599,9 +665,17 @@ watch(selected, () => { - - Select a document - Choose a documentation topic from the sidebar to get started + + + Select a document + + + Choose a documentation topic from the sidebar to get + started + @@ -611,8 +685,12 @@ watch(selected, () => { v-if="showToc && currentToc.length > 0" class="hidden xl:block w-64 flex-shrink-0 sticky top-24 h-fit" > - - + + On This Page @@ -622,7 +700,12 @@ watch(selected, () => { @click.prevent="scrollToSection(item.id)" href="#" class="block text-sm text-gray-600 hover:text-blue-600 transition-colors py-1 border-l-2 border-transparent hover:border-blue-500 pl-3" - :class="[{'ml-4': item.level === 3}, activeSection === item.id ? 'border-blue-500 text-blue-700 font-semibold bg-blue-50' : '']" + :class="[ + { 'ml-4': item.level === 3 }, + activeSection === item.id + ? 'border-blue-500 text-blue-700 font-semibold bg-blue-50' + : '', + ]" > {{ item.title }} @@ -670,8 +753,9 @@ watch(selected, () => { line-height: 1.3; padding-left: 1.5rem; border-left: 4px solid transparent; - background: linear-gradient(white, white) padding-box, - linear-gradient(135deg, #3b82f6, #6366f1) border-box; + background: + linear-gradient(white, white) padding-box, + linear-gradient(135deg, #3b82f6, #6366f1) border-box; border-left: 4px solid; background-clip: padding-box, border-box; padding: 0.75rem 0 0.75rem 1.5rem; @@ -787,6 +871,7 @@ watch(selected, () => { border: 1px solid #334155; position: relative; overflow-x: auto; + margin-bottom: 5px !important; } .prose :where(pre):not(:where([class~="not-prose"] *))::before { @@ -799,6 +884,12 @@ watch(selected, () => { background: #3b82f6; } +.prose :where(code[class^="language-"], code[class*=" language-"]) { + background: none !important; + color: inherit !important; + border: none !important; +} + .prose :where(code):not(:where([class~="not-prose"] *)) { background: #f1f5f9; color: #3b82f6; @@ -810,12 +901,18 @@ watch(selected, () => { .prose :where(blockquote):not(:where([class~="not-prose"] *)) { border: none; - background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.08)); + background: linear-gradient( + 135deg, + rgba(59, 130, 246, 0.08), + rgba(99, 102, 241, 0.08) + ); margin: 2.5rem 0; padding: 2rem; border-radius: 1rem; position: relative; - box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + box-shadow: + 0 4px 6px -1px rgba(0, 0, 0, 0.1), + 0 2px 4px -1px rgba(0, 0, 0, 0.06); border-left: 4px solid transparent; background-clip: padding-box; overflow: hidden; @@ -848,7 +945,9 @@ watch(selected, () => { border: 1px solid #e5e7eb; border-radius: 1rem; overflow: hidden; - box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + box-shadow: + 0 4px 6px -1px rgba(0, 0, 0, 0.1), + 0 2px 4px -1px rgba(0, 0, 0, 0.06); background: white; margin: 2.5rem 0; } @@ -880,7 +979,11 @@ watch(selected, () => { } .prose :where(tr):not(:where([class~="not-prose"] *)):hover { - background: linear-gradient(135deg, rgba(59, 130, 246, 0.02), rgba(99, 102, 241, 0.02)); + background: linear-gradient( + 135deg, + rgba(59, 130, 246, 0.02), + rgba(99, 102, 241, 0.02) + ); } /* Add some visual enhancements */ @@ -895,7 +998,12 @@ watch(selected, () => { left: -2rem; width: 2px; height: 100%; - background: linear-gradient(to bottom, transparent, rgba(59, 130, 246, 0.3), transparent); + background: linear-gradient( + to bottom, + transparent, + rgba(59, 130, 246, 0.3), + transparent + ); border-radius: 1px; } @@ -939,7 +1047,8 @@ html { /* Transitions */ .transition-colors { - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; + transition-property: color, background-color, border-color, + text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; } @@ -955,13 +1064,13 @@ html { .prose { max-width: none; } - + .prose :where(pre):not(:where([class~="not-prose"] *)) { background: #f8f9fa !important; color: #212529 !important; border: 1px solid #dee2e6 !important; } - + .prose :where(code):not(:where([class~="not-prose"] *)) { background: #f8f9fa !important; color: #212529 !important; @@ -973,13 +1082,13 @@ html { display: inline-block; margin-right: 0.5em; } -.prose blockquote p strong:contains('Note:') { +.prose blockquote p strong:contains("Note:") { color: #2563eb; } -.prose blockquote p strong:contains('Warning:') { +.prose blockquote p strong:contains("Warning:") { color: #f59e42; } -.prose blockquote p strong:contains('Tip:') { +.prose blockquote p strong:contains("Tip:") { color: #10b981; } .prose blockquote { @@ -988,7 +1097,7 @@ html { padding: 1.5rem 2rem; margin: 2rem 0; border-radius: 0.75rem; - box-shadow: 0 2px 8px 0 rgba(59,130,246,0.04); + box-shadow: 0 2px 8px 0 rgba(59, 130, 246, 0.04); } /* Responsive tables */ .prose table { @@ -997,7 +1106,8 @@ html { overflow-x: auto; border-radius: 0.5rem; } -.prose th, .prose td { +.prose th, +.prose td { white-space: nowrap; } /* Code block improvements */ @@ -1021,7 +1131,9 @@ html { border: 1px solid #e2e8f0; } /* Spacing tweaks for readability */ -.prose p, .prose ul, .prose ol { +.prose p, +.prose ul, +.prose ol { margin-bottom: 1.5em; } .prose h2 { @@ -1054,26 +1166,26 @@ hr { background: linear-gradient(135deg, #eff6ff 80%, #f0fdfa 100%); margin: 2.5rem 0; border-radius: 0.75rem; - box-shadow: 0 2px 8px 0 rgba(59,130,246,0.04); + box-shadow: 0 2px 8px 0 rgba(59, 130, 246, 0.04); } .prose blockquote p strong { display: inline-block; margin-right: 0.5em; } -.prose blockquote p strong:contains('Note:')::before { - content: '\2139'; /* info icon */ +.prose blockquote p strong:contains("Note:")::before { + content: "\2139"; /* info icon */ color: #2563eb; font-size: 1.2em; margin-right: 0.5em; } -.prose blockquote p strong:contains('Warning:')::before { - content: '\26A0'; /* warning icon */ +.prose blockquote p strong:contains("Warning:")::before { + content: "\26A0"; /* warning icon */ color: #f59e42; font-size: 1.2em; margin-right: 0.5em; } -.prose blockquote p strong:contains('Tip:')::before { - content: '\1F4A1'; /* lightbulb icon */ +.prose blockquote p strong:contains("Tip:")::before { + content: "\1F4A1"; /* lightbulb icon */ color: #10b981; font-size: 1.2em; margin-right: 0.5em; @@ -1084,7 +1196,7 @@ hr { } /* Custom bullets for lists */ .prose ul > li::before { - content: '\2022'; + content: "\2022"; color: #3b82f6; font-size: 1.2em; margin-right: 0.75em; @@ -1105,8 +1217,10 @@ hr { } /* Card shadow for main content */ .main-content { - box-shadow: 0 8px 32px 0 rgba(30, 64, 175, 0.10), 0 1.5px 4px 0 rgba(59,130,246,0.04); + box-shadow: + 0 8px 32px 0 rgba(30, 64, 175, 0.1), + 0 1.5px 4px 0 rgba(59, 130, 246, 0.04); border-radius: 1.25rem; background: linear-gradient(135deg, #f8fafc 80%, #f0fdfa 100%); } - \ No newline at end of file +
Loading documentation...
Please try refreshing the page
Choose a documentation topic from the sidebar to get started
+ Choose a documentation topic from the sidebar to get + started +