Skip to content

Commit

Permalink
feat: add docs to landing
Browse files Browse the repository at this point in the history
thewh1teagle committed Dec 18, 2024

Verified

This commit was signed with the committer’s verified signature.
1 parent d5c60e1 commit 6c85b58
Showing 20 changed files with 254 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ body:
Please, if possible, just open settings in vibe, and click 'Report Bug'
This way I'll get all the relevant info required
If not reported, if possible please check [Debug.md](https://github.com/thewh1teagle/vibe/blob/main/docs/DEBUG.md) and add comments with more info.
If not reported, if possible please check [Debug.md](https://github.com/thewh1teagle/vibe/blob/main/landing/docs/debug.md) and add comments with more info.
- type: textarea
id: what-happened
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@

# Install notes

See [Install.md](docs/INSTALL.md)
See [Install.md](landing/docs/install.md)

# Contribute 🤝

@@ -100,7 +100,7 @@ In addition you can add translation to [Vibe website](https://thewh1teagle.githu

# Build 🛠️

see [BUILDING.md](docs/BUILDING.md)
see [BUILDING.md](landing/static/docs/building.md)

# I want to know more!

4 changes: 2 additions & 2 deletions desktop/src/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export const aboutURL = 'https://thewh1teagle.github.io/vibe/'
export const updateVersionURL = 'https://github.com/thewh1teagle/vibe/releases/latest'
export const modelsURL = 'https://github.com/thewh1teagle/vibe/blob/main/docs/MODELS.md#vibe-models'
export const modelsURL = 'https://thewh1teagle.github.io/vibe/docs#models'
export const discordURL = 'https://discord.gg/EcxWSstQN8'
export const unsupportedCpuReadmeURL = 'https://github.com/thewh1teagle/vibe/blob/main/docs/INSTALL.md#unsupported-cpus'
export const unsupportedCpuReadmeURL = 'https://thewh1teagle.github.io/vibe/docs#install'
export const supportVibeURL = 'https://thewh1teagle.github.io/vibe/?action=support-vibe'
export const storeFilename = 'app_config.json'
export const latestReleaseURL = 'https://github.com/thewh1teagle/vibe/releases/latest'
Binary file modified landing/bun.lockb
Binary file not shown.
3 changes: 3 additions & 0 deletions landing/package.json
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.3",
"sass": "^1.83.0",
"svelte": "^4.2.17",
"svelte-check": "^3.7.1",
"tailwindcss": "^3.4.3",
@@ -36,9 +37,11 @@
},
"type": "module",
"dependencies": {
"carta-md": "^4.6.7",
"i18next-browser-languagedetector": "^8.0.0",
"i18next-http-backend": "^2.5.2",
"is-mobile": "^4.0.0",
"marked": "^15.0.4",
"svelte-i18next": "^2.2.2",
"svelte-persisted-store": "^0.9.2"
}
42 changes: 27 additions & 15 deletions landing/src/components/Footer.svelte
Original file line number Diff line number Diff line change
@@ -9,23 +9,35 @@
</script>

<footer class="footer footer-center mt-36 p-10 bg-base-200 text-base-content rounded">
<PrivacyPolicy />
<KofiDialog />

<nav class="grid grid-flow-col gap-4">
<a class="link link-hover" href={base}>{t('home')}</a>
<a class="link link-hover" href={`${base}/features`}>{t('features')}</a>
<PrivacyPolicy />
<KofiDialog />
<button
on:click={() => {
// @ts-ignore
window?.['kofi-dialog'].showModal()
}}
class="link link-hover">{t('support-vibe')}</button>
<button
on:click={() => {
// @ts-ignore
window['privacy-policy-modal']?.showModal()
}}
class="link link-hover">{t('privacy-policy')}</button>

<li>
<a class="link link-hover" href={`${base}/features`}>{t('features')}</a>
</li>
<li>
<a href="/vibe/docs">{t('documentation')}</a>
</li>

<li>
<button
on:click={() => {
// @ts-ignore
window?.['kofi-dialog'].showModal()
}}
class="link link-hover">{t('support-vibe')}</button>
</li>
<li>
<button
on:click={() => {
// @ts-ignore
window['privacy-policy-modal']?.showModal()
}}
class="link link-hover">{t('privacy-policy')}</button>
</li>
</nav>
<nav>
<div class="grid grid-flow-col gap-4">
3 changes: 0 additions & 3 deletions landing/src/components/Nav.svelte
Original file line number Diff line number Diff line change
@@ -17,8 +17,5 @@
<li>
<a href={`${base}/features`}>{t('features')}</a>
</li>
<li>
<a href="https://github.com/thewh1teagle/vibe" target="_blank">Github</a>
</li>
</ul>
</div>
55 changes: 55 additions & 0 deletions landing/src/routes/docs/+page.svelte
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>
156 changes: 156 additions & 0 deletions landing/src/routes/docs/DocViewer.svelte
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.
2 changes: 2 additions & 0 deletions docs/INSTALL.md → landing/static/docs/install.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,9 @@
## System Requirements

Windows: Version `8` or greater.

macOS: Version `13.3` or greater.

Linux: Tested on `ubuntu-22.04+`

Hardware:
File renamed without changes.
1 change: 1 addition & 0 deletions landing/static/locales/en-US.json
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
"cancel": "Cancel",
"copy-download-link": "Copy Download Link",
"description": "Experience seamless language transcription with Vibe - your all-in-one solution for effortless audio and video transcription.",
"documentation": "Docs",
"download": "Download",
"download-for": "Download For ",
"download-on-pc": "Download On PC",
1 change: 1 addition & 0 deletions landing/static/locales/es-MX.json
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
"cancel": "Cancelar",
"copy-download-link": "Copiar enlace de descarga",
"description": "Experimenta la transcripción de idiomas sin problemas con Vibe: su solución todo en uno para transcribir audio y vídeo sin esfuerzo.",
"documentation": "Documentación",
"download": "Descargar",
"download-for": "Descargar para ",
"download-on-pc": "Descargar para PC",
1 change: 1 addition & 0 deletions landing/static/locales/fr-FR.json
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
"cancel": "Annuler",
"copy-download-link": "Copier le lien de téléchargement",
"description": "Découvrez la transcription linguistique sans faille avec Vibe - votre solution tout-en-un pour une transcription audio et vidéo hors-ligne et sans effort.",
"documentation": "Documentation",
"download": "Télécharger",
"download-for": "Télécharger pour ",
"download-on-pc": "Télécharger sur PC",
1 change: 1 addition & 0 deletions landing/static/locales/he-IL.json
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
"cancel": "סגירה",
"copy-download-link": "העתק קישור להורדה",
"description": "Vibe זו תוכנה שמאפשרת לתמלל קבצי אודיו או וידאו בכמה לחיצות, בעזרת מודל בינה מלאכותית שרץ על המחשב שלכם. היא תומכת במעל 100 שפות כולל עברית.",
"documentation": "תיעוד",
"download": "הורדה",
"download-for": "הורדה ל",
"download-on-pc": "זמין להורדה במחשב",
1 change: 1 addition & 0 deletions landing/static/locales/pl-PL.json
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
"cancel": "Anuluj",
"copy-download-link": "Skopiuj link do pobrania",
"description": "Doświadcz płynnej transkrypcji językowej dzięki Vibe — uniwersalnemu rozwiązaniu do łatwej transkrypcji audio i wideo.",
"documentation": "Dokumenty",
"download": "Pobierz",
"download-for": "Pobierz dla ",
"download-on-pc": "Pobierz na PC",
1 change: 1 addition & 0 deletions landing/static/locales/pt-BR.json
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
"cancel": "Cancelar",
"copy-download-link": "Copiar link de download",
"description": "Experimente a transcrição de idiomas sem interrupções com o Vibe - sua solução completa para transcrição de áudio e vídeo sem esforço.",
"documentation": "Documentação",
"download": "Download",
"download-for": "Download Para ",
"download-on-pc": "Download no PC",

0 comments on commit 6c85b58

Please sign in to comment.