This package implements MiniZinc language support for the CodeMirror code editor, based on MiniZinc playground.
The project page has more information, a number of examples and the documentation.
This code is released under an MIT license.
We aim to be an inclusive, welcoming community. To make that explicit, we have a code of conduct that applies to communication around the project.
import { EditorView, basicSetup } from "codemirror";
import { MiniZinc } from "@live-codes/lang-minizinc";
const code = `
include "all_different.mzn";
int: n = 8;
array [1..n] of var 1..n: q; % queen in column i is in row q[i]
constraint all_different(q); % distinct rows
constraint all_different([q[i] + i | i in 1..n]); % distinct diagonals
constraint all_different([q[i] - i | i in 1..n]); % upwards+downwards
`;
const view = new EditorView({
parent: document.body,
doc: code,
extensions: [basicSetup, MiniZinc()],
});-
MiniZinc() → LanguageSupport Language support for MiniZinc.
-
MiniZincLanguage: LRLanguage A language provider for MiniZinc with highlighting and indentation information.