Files
katenary/doc/docs/statics/addons.js

21 lines
619 B
JavaScript
Raw Normal View History

2022-06-14 09:25:43 +02:00
function hljsInstall() {
const version = "11.5.1";
const theme = "github-dark";
const script = document.createElement("script");
script.src = `//cdnjs.cloudflare.com/ajax/libs/highlight.js/${version}/highlight.min.js`;
script.onload = () => {
const style = document.createElement("link");
style.rel = "stylesheet";
style.href = `//cdnjs.cloudflare.com/ajax/libs/highlight.js/${version}/styles/${theme}.min.css`;
document.head.appendChild(style);
2022-06-14 10:08:22 +02:00
hljs.highlightAll();
2022-06-14 09:25:43 +02:00
};
document.head.appendChild(script);
}
2022-06-13 13:18:31 +02:00
document.addEventListener("DOMContentLoaded", () => {
2022-06-14 09:25:43 +02:00
hljsInstall();
2022-06-13 13:18:31 +02:00
});