oliverdavies.uk/website/assets/js/app.js

20 lines
705 B
JavaScript

import "focus-visible";
import bash from "highlight.js/lib/languages/bash";
import hljs from "highlight.js/lib/core";
import ini from "highlight.js/lib/languages/ini";
import javascript from "highlight.js/lib/languages/javascript";
import php from "highlight.js/lib/languages/php";
import yaml from "highlight.js/lib/languages/yaml";
hljs.registerLanguage("bash", bash);
hljs.registerLanguage("ini", ini);
hljs.registerLanguage("javascript", javascript);
hljs.registerLanguage("php", php);
hljs.registerLanguage("yaml", yaml);
document.addEventListener("DOMContentLoaded", (event) => {
document.querySelectorAll("pre code").forEach((element) => {
hljs.highlightElement(element);
});
});