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
variant="link"
class="h-6 px-0 text-muted-foreground"
href={getURLForLanguage('/[...language]/documentation', $locale)}
href={getURLForLanguage('/[...language]/help', $locale)}
>
<BookOpenText size="16" class="mr-1" />
{$_('homepage.documentation')}
{$_('menu.help')}
</Button>
</div>
<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">
<Button
variant="ghost"
href={getURLForLanguage('/[...language]/documentation', $locale)}
href={getURLForLanguage('/[...language]/help', $locale)}
target="_blank"
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">
<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-7 hidden sm:block" />
<Logo class="h-8 hidden sm:block" />
</a>
<Button
variant="link"
@@ -32,10 +32,10 @@
<Button
variant="link"
class="text-base px-0"
href={getURLForLanguage('/[...language]/documentation', $locale)}
href={getURLForLanguage('/[...language]/help', $locale)}
>
<BookOpenText size="18" class="mr-1.5" />
{$_('homepage.documentation')}
{$_('menu.help')}
</Button>
<ModeSwitch class="ml-auto" />
</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';
export let path: string;
export let titleOnly: boolean = false;
let module = undefined;
let metadata: Record<string, any> = {};
const modules = import.meta.glob('/src/lib/docs/**/*.{md,svx}');
$: if ($locale) {
modules[`/src/lib/docs/${$locale}/${path}`]().then((mod) => {
function loadModule(path: string) {
modules[path]().then((mod) => {
module = mod.default;
metadata = mod.metadata;
});
}
$: if ($locale) {
loadModule(`/src/lib/docs/${$locale}/${path}`);
}
</script>
{#if module !== undefined}
<div class="markdown space-y-3">
<svelte:component this={module} />
</div>
{#if titleOnly}
{metadata.title}
{:else}
<div class="markdown space-y-3">
<svelte:component this={module} />
</div>
{/if}
{/if}
<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';
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';
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) => {
const url = page.replace('.html', '').replace('index', '');
if (languages[url]) {
const rootDir = url.split('/')[0];
if (languages[url] || languages[rootDir]) {
// Skip localized pages
return;
}