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

20 lines
705 B
JavaScript
Raw Normal View History

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";
2021-06-30 07:00:00 +00:00
hljs.registerLanguage("bash", bash);
hljs.registerLanguage("ini", ini);
hljs.registerLanguage("javascript", javascript);
hljs.registerLanguage("php", php);
hljs.registerLanguage("yaml", yaml);
2021-06-30 07:00:00 +00:00
document.addEventListener("DOMContentLoaded", (event) => {
document.querySelectorAll("pre code").forEach((element) => {
hljs.highlightElement(element);
});
});