wip
This commit is contained in:
12
playground/src/routes/+layout.svelte
Normal file
12
playground/src/routes/+layout.svelte
Normal file
@@ -0,0 +1,12 @@
|
||||
<script lang="ts">
|
||||
import '../app.css';
|
||||
import favicon from '$lib/assets/favicon.svg';
|
||||
|
||||
let { children } = $props();
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<link rel="icon" href={favicon} />
|
||||
</svelte:head>
|
||||
|
||||
{@render children?.()}
|
33
playground/src/routes/+page.svelte
Normal file
33
playground/src/routes/+page.svelte
Normal file
@@ -0,0 +1,33 @@
|
||||
<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>
|
||||
:global(body) {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
background: white;
|
||||
}
|
||||
|
||||
:global(*) {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
:global(textarea:focus) {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
:global(pre) {
|
||||
margin: 0;
|
||||
font-family:
|
||||
'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
|
||||
}
|
||||
</style>
|
47
playground/src/routes/+page.svelte2
Normal file
47
playground/src/routes/+page.svelte2
Normal file
@@ -0,0 +1,47 @@
|
||||
<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>
|
Reference in New Issue
Block a user