You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
799 B
34 lines
799 B
import "code-prettify/styles/desert.css";
|
|
import "bootstrap-icons/font/bootstrap-icons.css";
|
|
|
|
import "code-prettify";
|
|
|
|
import "./style/index.scss";
|
|
|
|
const applyPrettyPrint = () => {
|
|
|
|
const blogPosts = document.getElementsByClassName("blog-post-content");
|
|
for (const blogPost of blogPosts) {
|
|
|
|
const codeBlocks = blogPost.getElementsByTagName("code");
|
|
for (const codeBlock of codeBlocks) {
|
|
codeBlock.parentElement.classList.add("prettyprint", "linenums", "kg-card", "kg-code-card");
|
|
}
|
|
}
|
|
|
|
PR.prettyPrint();
|
|
}
|
|
|
|
const init = () => {
|
|
applyPrettyPrint();
|
|
}
|
|
|
|
if (document.readyState === "complete" || document.readyState === "interactive") {
|
|
requestAnimationFrame(init);
|
|
} else {
|
|
document.addEventListener("DOMContentLoaded", init);
|
|
}
|
|
|
|
|
|
|
|
|
|
|