docs progress

This commit is contained in:
vcoppe
2024-07-09 17:49:18 +02:00
parent d46cb4c2e5
commit 7264445926
40 changed files with 470 additions and 68 deletions

View File

@@ -4,13 +4,7 @@
import { locale } from 'svelte-i18n';
import DocsLoader from '$lib/components/docs/DocsLoader.svelte';
import { page } from '$app/stores';
let guides: Record<string, string[]> = {
'getting-started': [],
menu: ['file', 'edit', 'view', 'settings'],
toolbar: ['routing', 'poi', 'scissors', 'time', 'merge', 'extract', 'reduce', 'clean'],
'map-controls': []
};
import { guides } from '$lib/components/docs/docs';
</script>
<div class="p-12 flex flex-row gap-24">
@@ -24,7 +18,7 @@
? 'font-semibold text-foreground'
: ''}"
>
<DocsLoader path={`${guide}.svx`} titleOnly={true} />
<DocsLoader path={`${guide}.mdx`} titleOnly={true} />
</Button>
{#each guides[guide] as subGuide}
<Button
@@ -36,10 +30,12 @@
? 'font-semibold text-foreground'
: ''}"
>
<DocsLoader path={`${guide}/${subGuide}.svx`} titleOnly={true} />
<DocsLoader path={`${guide}/${subGuide}.mdx`} titleOnly={true} />
</Button>
{/each}
{/each}
</div>
<slot />
<div class="grow">
<slot />
</div>
</div>

View File

@@ -1,6 +1,36 @@
<script lang="ts">
import { page } from '$app/stores';
import { getNextGuide, getPreviousGuide } from '$lib/components/docs/docs';
import DocsLoader from '$lib/components/docs/DocsLoader.svelte';
import { Button } from '$lib/components/ui/button';
import { getURLForLanguage } from '$lib/utils';
import { ChevronLeft, ChevronRight } from 'lucide-svelte';
$: previousGuide = getPreviousGuide($page.params.guide);
$: nextGuide = getNextGuide($page.params.guide);
</script>
<DocsLoader path="{$page.params.guide}.svx" />
<DocsLoader path="{$page.params.guide}.mdx" />
<div class="flex flex-row pt-6">
{#if previousGuide}
<Button
variant="outline"
class="mr-auto"
href={getURLForLanguage(undefined, `/help/${previousGuide}`)}
>
<ChevronLeft size="14" class="mr-1 mt-0.5" />
<DocsLoader path="{previousGuide}.mdx" titleOnly={true} />
</Button>
{/if}
{#if nextGuide}
<Button
variant="outline"
class="ml-auto"
href={getURLForLanguage(undefined, `/help/${nextGuide}`)}
>
<DocsLoader path="{nextGuide}.mdx" titleOnly={true} />
<ChevronRight size="14" class="ml-1 mt-0.5" />
</Button>
{/if}
</div>