-
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
feat: add docs to landing
1 parent
d5c60e1
commit 6c85b58
Showing
20 changed files
with
254 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<script> | ||
import DocViewer from './DocViewer.svelte' | ||
// List of available documentation files | ||
const docs = [ | ||
{ name: 'Install', url: '/vibe/docs/install.md' }, | ||
{ name: 'Models', url: '/vibe/docs/models.md' }, | ||
{ name: 'Debug', url: '/vibe/docs/debug.md' }, | ||
{ name: 'Build', url: '/vibe/docs/building.md' }, | ||
] | ||
// Set default selected document based on hash or default to the first doc | ||
let url = window.location.hash ? getDocUrl(window.location.hash) : docs[0].url | ||
// Watch for hash changes | ||
window.addEventListener('hashchange', () => { | ||
url = getDocUrl(window.location.hash) | ||
}) | ||
// Helper function to get the corresponding URL for a hash | ||
function getDocUrl(hash) { | ||
const docName = hash.replace('#', '') // Remove '#' from the hash | ||
const doc = docs.find((d) => d.name.toLowerCase() === docName.toLowerCase()) | ||
return doc ? doc.url : docs[0].url // Default to the first doc if not found | ||
} | ||
</script> | ||
|
||
<div class="max-w-[81%] lg:max-w-[680px] m-auto" dir="ltr"> | ||
<h1 class="text-4xl font-bold mb-6">Vibe Documentation</h1> | ||
|
||
<!-- Navigation --> | ||
<div class="tabs tabs-boxed mb-8"> | ||
{#each docs as doc} | ||
<button | ||
class="tab {url === doc.url ? 'tab-active' : ''}" | ||
on:click={() => { | ||
url = doc.url | ||
window.location.hash = doc.name.toLowerCase() // Update hash | ||
}}> | ||
{doc.name} | ||
</button> | ||
{/each} | ||
</div> | ||
|
||
<!-- Content Area --> | ||
<div> | ||
<DocViewer {url} /> | ||
</div> | ||
</div> | ||
|
||
<style> | ||
.tabs { | ||
justify-content: center; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
<script lang="ts"> | ||
import { marked } from 'marked' | ||
import { onMount } from 'svelte' | ||
let markdown = 'Loading...' // Initial loading message | ||
export let url: string | ||
$: if (url) { | ||
loadContent(url) | ||
} | ||
async function loadContent(url: string) { | ||
if (!url) { | ||
markdown = 'No document selected.' | ||
return | ||
} | ||
try { | ||
markdown = 'Loading...' // Show loading state | ||
const response = await fetch(url) | ||
if (!response.ok) { | ||
throw new Error(`Failed to fetch ${url}: ${response.statusText}`) | ||
} | ||
markdown = await marked(await response.text()) | ||
} catch (error) { | ||
console.error('Error loading document:', error) | ||
markdown = 'Failed to load document.' | ||
} | ||
} | ||
</script> | ||
|
||
<div class="h-100vh"> | ||
<div class="markdown">{@html marked(markdown)}</div> | ||
</div> | ||
|
||
<style lang="scss"> | ||
.markdown { | ||
:global(h1) { | ||
font-size: 36px !important; | ||
font-weight: bold; | ||
margin-bottom: 16px; | ||
} | ||
:global(h2) { | ||
font-size: 30px !important; | ||
font-weight: bold; | ||
margin-bottom: 14px; | ||
} | ||
:global(h3) { | ||
font-size: 24px !important; | ||
font-weight: bold; | ||
margin-bottom: 12px; | ||
} | ||
:global(h4) { | ||
font-size: 20px !important; | ||
font-weight: bold; | ||
margin-bottom: 10px; | ||
} | ||
:global(h5) { | ||
font-size: 16px !important; | ||
font-weight: bold; | ||
margin-bottom: 8px; | ||
} | ||
:global(h6) { | ||
font-size: 14px !important; | ||
font-weight: bold; | ||
margin-bottom: 6px; | ||
} | ||
:global(p) { | ||
font-size: 16px; | ||
line-height: 1.6; | ||
margin-bottom: 16px; | ||
} | ||
:global(ul), | ||
:global(ol) { | ||
margin-bottom: 16px; | ||
padding-left: 20px; | ||
} | ||
:global(li) { | ||
font-size: 16px; | ||
line-height: 1.6; | ||
margin-bottom: 8px; | ||
} | ||
:global(blockquote) { | ||
font-size: 18px; | ||
font-style: italic; | ||
border-left: 4px solid #ccc; | ||
padding-left: 16px; | ||
margin-bottom: 16px; | ||
color: #555; | ||
} | ||
:global(code), | ||
:global(pre) { | ||
font-family: 'Courier New', monospace; | ||
background-color: #272727; | ||
border-radius: 4px; | ||
padding: 2px 5px; | ||
} | ||
/* Dark mode */ | ||
@media (prefers-color-scheme: dark) { | ||
:global(pre), | ||
:global(code) { | ||
background-color: #272727; | ||
color: #f4f4f4; | ||
} | ||
} | ||
/* Light mode */ | ||
@media (prefers-color-scheme: light) { | ||
:global(pre), | ||
:global(code) { | ||
background-color: #ffffff; | ||
color: #333333; | ||
} | ||
} | ||
:global(pre) { | ||
padding: 8px; | ||
overflow-x: auto; | ||
} | ||
:global(a) { | ||
color: #1e90ff; | ||
text-decoration: none; | ||
} | ||
:global(a:hover) { | ||
text-decoration: underline; | ||
} | ||
:global(img) { | ||
max-width: 100%; | ||
height: auto; | ||
display: block; | ||
margin: 0 auto; | ||
} | ||
:global(strong) { | ||
font-weight: bold; | ||
} | ||
:global(em) { | ||
font-style: italic; | ||
} | ||
} | ||
</style> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters