@exercism/highlightjs-odin
v1.0.1
Published
Odin language support for Highlight.js
Readme
highlightjs-odin ·

This repository contains a Highlight.js plugin for the Odin language.
It registers under the name odin, with the aliases odin-lang and odinlang.
The grammar uses no regex lookbehind, so it is safe to load in browsers without lookbehind support.
Installation
To install the package, run:
npm install @exercism/highlightjs-odinThen register the language:
import hljs from "highlight.js";
import hljsDefineOdin from "@exercism/highlightjs-odin";
hljs.registerLanguage("odin", hljsDefineOdin);Tests
To run the tests, run:
bun testThe files in test/markup/ are Odin sources, each with the HTML it should highlight to in a matching .expected file.
Most of them are example solutions from the Exercism Odin track.
After a deliberate change to the grammar, regenerate the .expected files and check the differences by hand.
Publish on NPM
To publish the package, run:
bun publishLocal development
First, install the dependencies:
bun installThen run:
bun devThis will start a Vite dev server with a page of highlighted Odin code.
