MML is a meaning-first markup language that remains readable as plain text. This package parses MML, validates its structure, and compiles valid documents to HTML.
Open the live parser · Project documentation · Language specification
Save this as example.mml:
argument
claim
MML is readable as plain text.
evidence
Each opening tag sits on its own line.
Run this from the folder containing the file:
npx @monapdx/mml example.mmlThe command prints compiled HTML. Add > example.html to save the output. If the source is invalid, the command prints diagnostics and exits with an error.
For regular use, install the command globally with npm install -g @monapdx/mml, then run mml example.mml.
npm install @monapdx/mmlSave this as example.mjs and run node example.mjs.
import { processSource } from "@monapdx/mml";
const source = `argument
claim
Markdown introduces an unnecessary abstraction layer.
evidence
The final rendered output is already HTML.`;
const result = processSource(source);
if (result.valid) {
console.log(result.html);
} else {
console.error(result.parseErrors, result.validationErrors);
}processSource also returns the syntax tree as ast and its JSON representation as astJson. Use the named exports parse, validate, and compile if you need to run the stages separately. The package uses ES modules.