This commit is contained in:
Max Richter
2025-09-25 17:28:59 +02:00
parent b13d5015f4
commit 96e7f72d1f
13 changed files with 336 additions and 123 deletions

View File

@@ -7,6 +7,7 @@
<svelte:head>
<link rel="icon" href={favicon} />
<script src="/wasm_exec.js"></script>
</svelte:head>
{@render children?.()}

View File

@@ -1,13 +1,11 @@
<script lang="ts">
import Header from '$lib/components/Header.svelte';
import Playground from '$lib/components/Playground.svelte';
import StatusBar from '$lib/components/StatusBar.svelte';
</script>
<div class="bg-background text-foreground flex min-h-screen flex-col">
<Header />
<Playground />
<StatusBar />
</div>
<style>

View File

@@ -1,47 +0,0 @@
<script lang="ts">
import {onMount} from 'svelte';
const test = `---
_type: Recipe
author.name: Max Richter
---
# Baguette
My favourite baguette recipe
## Ingredients
- Flour
- Water
- Salt
## Steps
1. Mix Flour Water and Salt
2. Bake the bread
`
function exec(){
let start = performance.now();
const res = markaParseFile(test);
let end = performance.now();
console.log(JSON.parse(res))
start = performance.now();
const res2 = markaMatchBlocks(test);
end = performance.now();
console.log(JSON.parse(res2))
}
onMount(async () => {
const go = new Go();
WebAssembly.instantiateStreaming(fetch("/main.wasm"), go.importObject).then((result) => {
go.run(result.instance);
});
});
</script>
<button onclick={exec}>test</button>