add readme

This commit is contained in:
Travis Shears 2026-03-20 12:35:44 +01:00
parent 5848b471ec
commit 0a6fb0e954
Signed by: travisshears
GPG key ID: CB9BF1910F3F7469
4 changed files with 67 additions and 7 deletions

View file

@ -1,3 +1,4 @@
import { z } from "zod";
import { renderMermaidSVG } from "beautiful-mermaid";
const args = process.argv.slice(2);
@ -8,7 +9,10 @@ if (args.length < 2) {
process.exit(1);
}
const [inputPath, outputPath] = args;
const argsSchema = z.tuple([z.string(), z.string()]);
const parsed = argsSchema.parse(args);
const [inputPath, outputPath] = parsed;
try {
// Read the .mmd file
@ -25,7 +29,9 @@ try {
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
console.error(`✗ Input file not found: ${inputPath}`);
} else {
console.error(`✗ Error: ${error instanceof Error ? error.message : String(error)}`);
console.error(
`✗ Error: ${error instanceof Error ? error.message : String(error)}`,
);
}
process.exit(1);
}