Svelte Study

Svelte에서 highlight.js 연동 -1132

Code 3개 언어

// 정말 필요한 언어만 import 하고 싶다면,  
import hljs from 'highlight.js/lib/core';
import javascript from 'highlight.js/lib/languages/javascript';
import julia from 'highlight.js/lib/languages/julia';
import go from 'highlight.js/lib/languages/go';

hljs.registerLanguage('javascript', javascript);
hljs.registerLanguage('julia', julia);
hljs.registerLanguage('go', go);
package main

import "fmt"

func main() {
	fmt.Println("Hello, 世界")
}
<!-- 여기는 적용되지 않는다. -->
<div class="row">
    <span>Hello World!</span>
</div>
function f(x, y)
    x[1] = 42    # mutates x
    y = 7 + y    # new binding for y, no mutation
    return y
end