Add PlaygroundSyntax

This commit is contained in:
kwaroran
2024-04-24 22:11:38 +09:00
parent c5d6dbfd8b
commit 71c7e088e5

View File

@@ -0,0 +1,26 @@
<script lang="ts">
import { Template } from '@huggingface/jinja';
import TextAreaInput from "../UI/GUI/TextAreaInput.svelte";
import { risuChatParser } from 'src/ts/parser';
let input = "";
let output = "";
const onInput = async () => {
try {
output = risuChatParser(input, {
consistantChar: true,
})
} catch (e) {
output = `Error: ${e}`
}
}
</script>
<h2 class="text-4xl text-textcolor my-6 font-black relative">Jinja</h2>
<span class="text-textcolor text-lg">Input</span>
<TextAreaInput onInput={onInput} bind:value={input} height="32" />
<span class="text-textcolor text-lg">Result</span>
<TextAreaInput value={output} height="32" />