Lox syntax support for highlight.js
npm install highlightjs-loxThis repository provides syntax highlighting for the Lox language using highlight.js.
``json`
{
"highlight.js": "^11.3.1"
}
Provided in the dist/ folder are 5 versions: iife (for browsers), es, umd, cjs, and amd (+ lox.mjs & lox.cjs in case they're needed). min and map files included also :sunglasses:.
To import lox make sure to include lox.js in the HTML:
`html`
and then:
`html`
This will find and highlight code inside of
tags; it tries to detect the language automatically. If automatic detection doesn’t work for you, you can specify the language in the class attribute:`html
...
`$3
ES Modules, CommonJS, AMD and UMD can all be found in the
dist/ folder.To add the package run:
`sh
npm
npm install highlight.js
npm install highlightjs-loxyarn
yarn add highlight.js
yarn add highlightjs-lox
`#### ES6+ module syntax
`js
import hljs from "highlight.js"
import lox from "highlightjs-lox"hljs.registerLanguage("lox", lox)
hljs.initHighlightingOnLoad()
`#### CommonJS syntax
`js
const hljs = require("highlight.js")
const lox = require("highlightjs-lox")
`$3
If you would like to see some more in depth examples you can check out the demo folderBuilding
Go to highlight.js and update lox.js directly into the library. Then run their build tool:`sh
node ./tools/build.js lox
``License