// Client-side rendering: syntax highlighting for source files and markdown // rendering for READMEs and .md files. (function () { "use strict"; function highlight() { if (typeof hljs === "undefined") return; document.querySelectorAll("pre.code > code.hljs").forEach(function (el) { hljs.highlightElement(el); }); } // Each ".markdown-src" element holds raw markdown and a data-target CSS // selector pointing at the element to render it into. function renderMarkdown() { if (typeof marked === "undefined") return; document.querySelectorAll(".markdown-src").forEach(function (src) { var target = document.querySelector(src.dataset.target); if (target) target.innerHTML = marked.parse(src.textContent); }); } document.addEventListener("DOMContentLoaded", function () { highlight(); renderMarkdown(); }); })();