highlightjs for odin
What I have for this website are
- an appropriate highlight.min.odin.js, which you can generate from the website.
- rudely tacked onto the end of that file, the following block (a combination of odin-lang.org code taken from the source of the overview and some custom code to select code blocks from this site):
hljs.registerLanguage("odin",function(a){return{aliases:["odin","odinlang","odin-lang"],keywords:{keyword:"auto_cast bit_set break case cast context continue defer distinct do dynamic else enum fallthrough for foreign if import in map matrix not_in or_else or_return package proc return struct switch transmute type_of typeid union using when where",literal:"true false nil",built_in:"abs align_of cap clamp complex conj expand_to_tuple imag jmag kmag len max min offset_of quaternion real size_of soa_unzip soa_zip swizzle type_info_of type_of typeid_of"},illegal:"</",contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,{className:"string",variants:[a.QUOTE_STRING_MODE,{begin:"'",end:"[^\\\\]'"},{begin:"`",end:"`"}]},{className:"number",variants:[{begin:a.C_NUMBER_RE+"[ijk]",relevance:1},a.C_NUMBER_MODE]}]}}) //hljs.highlightAll() document.addEventListener( "DOMContentLoaded", function(event){ [ "shell", "d", "odin" ].forEach(function(L){ document.querySelectorAll( "pre > code.language-"+L ).forEach((block)=>hljs.highlightElement(block)); document.querySelectorAll( "div.language-"+L+" > pre.verbatim" ).forEach((block)=>hljs.highlightElement(block)); }); if (document.title.match(/\b\w+\.d\W/)) { document.querySelectorAll("blockquote.file-content > pre").forEach((block)=>hljs.highlightElement(block)) } } ) - a highlightjs style css, which you can also get from the highlightjs repo. This site is using base16's heetch-light.css.
- normal HTML inserts to load the above (baked into the Header for the fossil style)