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

This repository contains a highlight.js plugin for the Factor language.
Installation
To install the package, run:
npm install @exercism/highlightjs-factorThen register the language under the name factor:
import hljs from "highlight.js";
import hljsDefineFactor from "@exercism/highlightjs-factor";
hljs.registerLanguage("factor", hljsDefineFactor);The grammar uses no regex lookbehind, so it loads in every browser that highlight.js supports.
Tests
To run the tests, run:
bun testEach file in test/markup is some Factor code, and the .expected file next to it is the HTML that highlight.js should produce from it.
The solution-* files are example solutions from the Exercism Factor track.
To check the grammar against every example solution in a checkout of the Factor track, run:
bun bin/render-solutions path/to/factor path/to/output-dirIt lists the words given each highlight.js scope, so a word with the wrong colour stands out, and writes each solution's HTML to the output directory.
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 Factor code.
