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

This repository contains a highlightjs plugin for the Roc language.
It covers the current Roc syntax: match, for, while, var and $ variables, return, and/or, |x| lambdas, ${} interpolation (including nested strings), \\ multiline strings, character literals, numbers and type modules.
It uses no regex lookbehind, so it works in every browser.
Installation
To install the package, run:
npm install @exercism/highlightjs-rocThen register it with highlight.js:
import hljs from "highlight.js";
import setupRoc from "@exercism/highlightjs-roc";
hljs.registerLanguage("roc", setupRoc);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 that shows some highlighted Roc code.
Tests
To run the tests, run:
bun testEach test/markup/*.txt file is highlighted and compared with its .expected file.
Some of them are example solutions from the Roc track.
