mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-21 16:02:28 +00:00
27 lines
603 B
Svelte
27 lines
603 B
Svelte
<script lang="ts">
|
|
import Highlight from 'svelte-highlight'
|
|
import python from 'svelte-highlight/languages/python'
|
|
import typescript from 'svelte-highlight/languages/typescript'
|
|
import go from 'svelte-highlight/languages/go'
|
|
|
|
export let code: string = ''
|
|
export let language: 'python3' | 'deno' | 'go' | undefined
|
|
|
|
function getLang(lang: string | undefined) {
|
|
switch (lang) {
|
|
case 'python3':
|
|
return python
|
|
case 'deno':
|
|
return typescript
|
|
case 'go':
|
|
return go
|
|
default:
|
|
return python
|
|
}
|
|
}
|
|
|
|
$: lang = getLang(language)
|
|
</script>
|
|
|
|
<Highlight language={lang} {code} />
|