syntax highlightning example on jxr

code-generation
Fabien Benetou 2 years ago
parent 1ce813ebac
commit cbb4cbcd7e
  1. 6
      index.html

@ -2316,6 +2316,12 @@ consider pick then apply, i.e changeColorLastId() but for next Id
*/ */
jxrhighlight(){
[...document.querySelectorAll("[value]")]
.filter( el => (el.getAttribute("value").match(/^jxr /)))
.map( el => el.setAttribute("troika-text", {colorRanges: {0: 0x0099ff, 3: 0xffffff}}) )
// see also generalization via https://shiki.matsu.io custom renderers
}
</script> </script>
<div id="observablehq-key"> <div id="observablehq-key">

Loading…
Cancel
Save