user guide structure draft

This commit is contained in:
vcoppe
2024-07-08 22:43:50 +02:00
parent 2bcfba0fa4
commit ad7ff5ddba
36 changed files with 171 additions and 46 deletions

View File

Before

Width:  |  Height:  |  Size: 4.3 MiB

After

Width:  |  Height:  |  Size: 4.3 MiB

View File

Before

Width:  |  Height:  |  Size: 5.4 MiB

After

Width:  |  Height:  |  Size: 5.4 MiB

View File

Before

Width:  |  Height:  |  Size: 2.9 MiB

After

Width:  |  Height:  |  Size: 2.9 MiB

View File

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

Before

Width:  |  Height:  |  Size: 3.6 MiB

After

Width:  |  Height:  |  Size: 3.6 MiB

View File

Before

Width:  |  Height:  |  Size: 6.9 MiB

After

Width:  |  Height:  |  Size: 6.9 MiB

View File

Before

Width:  |  Height:  |  Size: 448 KiB

After

Width:  |  Height:  |  Size: 448 KiB

View File

@@ -44,10 +44,10 @@
<Button <Button
variant="link" variant="link"
class="h-6 px-0 text-muted-foreground" class="h-6 px-0 text-muted-foreground"
href={getURLForLanguage('/[...language]/documentation', $locale)} href={getURLForLanguage('/[...language]/help', $locale)}
> >
<BookOpenText size="16" class="mr-1" /> <BookOpenText size="16" class="mr-1" />
{$_('homepage.documentation')} {$_('menu.help')}
</Button> </Button>
</div> </div>
<div class="flex flex-col items-start gap-1" id="contact"> <div class="flex flex-col items-start gap-1" id="contact">

View File

@@ -417,7 +417,7 @@
<div class="h-fit flex flex-row items-center ml-1 gap-1"> <div class="h-fit flex flex-row items-center ml-1 gap-1">
<Button <Button
variant="ghost" variant="ghost"
href={getURLForLanguage('/[...language]/documentation', $locale)} href={getURLForLanguage('/[...language]/help', $locale)}
target="_blank" target="_blank"
class="cursor-default h-fit rounded-sm px-3 py-0.5" class="cursor-default h-fit rounded-sm px-3 py-0.5"
> >

View File

@@ -9,9 +9,9 @@
<nav class="w-full sticky top-0 bg-background z-10"> <nav class="w-full sticky top-0 bg-background z-10">
<div class="mx-6 py-2 flex flex-row items-center border-b gap-4 md:gap-8"> <div class="mx-6 py-2 flex flex-row items-center border-b gap-4 md:gap-8">
<a href={getURLForLanguage('/[...language]', $locale)} class="shrink-0"> <a href={getURLForLanguage('/[...language]', $locale)} class="shrink-0 translate-y-0.5">
<Logo class="h-8 sm:hidden" iconOnly={true} /> <Logo class="h-8 sm:hidden" iconOnly={true} />
<Logo class="h-7 hidden sm:block" /> <Logo class="h-8 hidden sm:block" />
</a> </a>
<Button <Button
variant="link" variant="link"
@@ -32,10 +32,10 @@
<Button <Button
variant="link" variant="link"
class="text-base px-0" class="text-base px-0"
href={getURLForLanguage('/[...language]/documentation', $locale)} href={getURLForLanguage('/[...language]/help', $locale)}
> >
<BookOpenText size="18" class="mr-1.5" /> <BookOpenText size="18" class="mr-1.5" />
{$_('homepage.documentation')} {$_('menu.help')}
</Button> </Button>
<ModeSwitch class="ml-auto" /> <ModeSwitch class="ml-auto" />
</div> </div>

View File

@@ -1,11 +0,0 @@
<script>
import Test, { metadata } from '$lib/docs/en/introduction/test.md';
const toc = {
introduction: ['test']
};
</script>
{metadata.title}
<Test />

View File

@@ -2,22 +2,33 @@
import { _, locale } from 'svelte-i18n'; import { _, locale } from 'svelte-i18n';
export let path: string; export let path: string;
export let titleOnly: boolean = false;
let module = undefined; let module = undefined;
let metadata: Record<string, any> = {};
const modules = import.meta.glob('/src/lib/docs/**/*.{md,svx}'); const modules = import.meta.glob('/src/lib/docs/**/*.{md,svx}');
$: if ($locale) { function loadModule(path: string) {
modules[`/src/lib/docs/${$locale}/${path}`]().then((mod) => { modules[path]().then((mod) => {
module = mod.default; module = mod.default;
metadata = mod.metadata;
}); });
} }
$: if ($locale) {
loadModule(`/src/lib/docs/${$locale}/${path}`);
}
</script> </script>
{#if module !== undefined} {#if module !== undefined}
<div class="markdown space-y-3"> {#if titleOnly}
<svelte:component this={module} /> {metadata.title}
</div> {:else}
<div class="markdown space-y-3">
<svelte:component this={module} />
</div>
{/if}
{/if} {/if}
<style lang="postcss"> <style lang="postcss">

View File

@@ -0,0 +1,11 @@
---
title: Getting started
---
# { title }
Welcome message.
- screenshot of the interface
explain main components of the interface and link to the corresponding sections

View File

@@ -1,5 +0,0 @@
---
title: Test
---
test

View File

@@ -0,0 +1,5 @@
---
title: Map controls
---
# { title }

View File

@@ -0,0 +1,6 @@
---
title: Menu
---
# { title }

View File

@@ -0,0 +1,5 @@
---
title: Edit
---
# { title }

View File

@@ -0,0 +1,5 @@
---
title: File
---
# { title }

View File

@@ -0,0 +1,5 @@
---
title: Settings
---
# { title }

View File

@@ -0,0 +1,5 @@
---
title: View
---
# { title }

View File

@@ -0,0 +1,6 @@
---
title: Toolbar
---
# { title }

View File

@@ -0,0 +1,5 @@
---
title: Clean
---
# { title }

View File

@@ -0,0 +1,5 @@
---
title: Extract
---
# { title }

View File

@@ -0,0 +1,5 @@
---
title: Merge
---
# { title }

View File

@@ -0,0 +1,5 @@
---
title: Points of interest
---
# { title }

View File

@@ -0,0 +1,5 @@
---
title: Reduce
---
# { title }

View File

@@ -0,0 +1,5 @@
---
title: Route planning and editing
---
# { title }

View File

@@ -0,0 +1,5 @@
---
title: Scissors
---
# { title }

View File

@@ -0,0 +1,5 @@
---
title: Time
---
# { title }

View File

@@ -3,7 +3,7 @@ import { glob } from 'glob';
import { languages } from '$lib/languages'; import { languages } from '$lib/languages';
function generateSitemap() { function generateSitemap() {
const pages = glob.sync('*.html', { cwd: 'build' }); const pages = glob.sync('**/*.html', { cwd: 'build' });
let sitemap = '<?xml version="1.0" encoding="UTF-8"?>\n'; let sitemap = '<?xml version="1.0" encoding="UTF-8"?>\n';
sitemap += '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">\n'; sitemap += '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">\n';
@@ -11,7 +11,8 @@ function generateSitemap() {
pages.forEach((page) => { pages.forEach((page) => {
const url = page.replace('.html', '').replace('index', ''); const url = page.replace('.html', '').replace('index', '');
if (languages[url]) { const rootDir = url.split('/')[0];
if (languages[url] || languages[rootDir]) {
// Skip localized pages // Skip localized pages
return; return;
} }

View File

@@ -2,7 +2,7 @@
"metadata": { "metadata": {
"home_title": "home", "home_title": "home",
"app_title": "the online GPX file editor", "app_title": "the online GPX file editor",
"documentation_title": "documentation", "help_title": "help",
"description": "View, edit and create GPX files online with advanced route planning capabilities and file processing tools, beautiful maps and detailed data visualizations." "description": "View, edit and create GPX files online with advanced route planning capabilities and file processing tools, beautiful maps and detailed data visualizations."
}, },
"menu": { "menu": {
@@ -349,7 +349,6 @@
"website": "Website", "website": "Website",
"home": "Home", "home": "Home",
"app": "App", "app": "App",
"documentation": "Documentation",
"contact": "Contact", "contact": "Contact",
"x": "X", "x": "X",
"facebook": "Facebook", "facebook": "Facebook",

View File

@@ -14,13 +14,13 @@
import { currentTool, Tool } from '$lib/stores'; import { currentTool, Tool } from '$lib/stores';
import { onDestroy, onMount } from 'svelte'; import { onDestroy, onMount } from 'svelte';
import { getURLForLanguage } from '$lib/utils'; import { getURLForLanguage } from '$lib/utils';
import routingScreenshot from '$lib/assets/img/routing.png?enhanced'; import routingScreenshot from '$lib/assets/img/home/routing.png?enhanced';
import mapboxOutdoorsMap from '$lib/assets/img/mapbox-outdoors.png?enhanced'; import mapboxOutdoorsMap from '$lib/assets/img/home/mapbox-outdoors.png?enhanced';
import mapboxSatelliteMap from '$lib/assets/img/mapbox-satellite.png?enhanced'; import mapboxSatelliteMap from '$lib/assets/img/home/mapbox-satellite.png?enhanced';
import ignMap from '$lib/assets/img/ign.png?enhanced'; import ignMap from '$lib/assets/img/home/ign.png?enhanced';
import cyclosmMap from '$lib/assets/img/cyclosm.png?enhanced'; import cyclosmMap from '$lib/assets/img/home/cyclosm.png?enhanced';
import waymarkedMap from '$lib/assets/img/waymarked.png?enhanced'; import waymarkedMap from '$lib/assets/img/home/waymarked.png?enhanced';
import mapScreenshot from '$lib/assets/img/map.png?enhanced'; import mapScreenshot from '$lib/assets/img/home/map.png?enhanced';
let gpxStatistics = writable(exampleGPXFile.getStatistics()); let gpxStatistics = writable(exampleGPXFile.getStatistics());
let slicedGPXStatistics = writable(undefined); let slicedGPXStatistics = writable(undefined);
@@ -52,11 +52,11 @@
</Button> </Button>
<Button <Button
variant="secondary" variant="secondary"
href={getURLForLanguage('/[...language]/documentation', $locale)} href={getURLForLanguage('/[...language]/help', $locale)}
class="w-1/3 min-w-fit" class="w-1/3 min-w-fit"
> >
<BookOpenText size="18" class="mr-1.5" /> <BookOpenText size="18" class="mr-1.5" />
<span>{$_('homepage.documentation')}</span> <span>{$_('homepage.help')}</span>
</Button> </Button>
</div> </div>
</div> </div>

View File

@@ -1,5 +0,0 @@
<script>
import Docs from '$lib/components/docs/Docs.svelte';
</script>
<Docs />

View File

@@ -0,0 +1,37 @@
<script lang="ts">
import { Button } from '$lib/components/ui/button';
import { getURLForLanguage } from '$lib/utils';
import { locale } from 'svelte-i18n';
import DocsLoader from '$lib/components/docs/DocsLoader.svelte';
let guides: Record<string, string[]> = {
'getting-started': [],
menu: ['file', 'edit', 'view', 'settings'],
toolbar: ['routing', 'poi', 'scissors', 'time', 'merge', 'extract', 'reduce', 'clean'],
'map-controls': []
};
</script>
<div class="p-12 flex flex-row gap-24">
<div class="hidden md:flex flex-col gap-1 w-40">
{#each Object.keys(guides) as guide}
<Button
variant="link"
href={getURLForLanguage(`/[...language]/help/${guide}`, $locale)}
class="h-6 p-0 w-fit text-muted-foreground hover:text-foreground hover:no-underline font-normal hover:font-semibold items-start"
>
<DocsLoader path={`${guide}.svx`} titleOnly={true} />
</Button>
{#each guides[guide] as subGuide}
<Button
variant="link"
href={getURLForLanguage(`/[...language]/help/${guide}/${subGuide}`, $locale)}
class="h-6 p-0 w-fit text-muted-foreground hover:text-foreground hover:no-underline font-normal hover:font-semibold items-start ml-3"
>
<DocsLoader path={`${guide}/${subGuide}.svx`} titleOnly={true} />
</Button>
{/each}
{/each}
</div>
<slot />
</div>

View File

@@ -0,0 +1,4 @@
<script>
</script>
<div></div>

View File

@@ -0,0 +1,6 @@
<script lang="ts">
import { page } from '$app/stores';
import DocsLoader from '$lib/components/docs/DocsLoader.svelte';
</script>
<DocsLoader path="{$page.params.guide}.svx" />