Skip to content

Repository files navigation

MermaidValidator

Rust-backed Elixir package for validating Mermaid diagram syntax.

Usage

MermaidValidator.validate("""
graph TD
  A --> B
""")

Returns :ok for valid diagrams and {:error, message} for invalid diagrams.

Local Development

The package uses rustler_precompiled for release artifacts. To force a local Rust build while developing or running tests:

MERMAID_VALIDATOR_BUILD=1 mix test

Precompiled NIF Releases

The GitHub Actions workflow at .github/workflows/precompiled-nifs.yaml builds the Rust NIF for the supported platform matrix. It can be run manually with workflow_dispatch for testing, and it publishes release assets when a v* tag is pushed.

Before publishing the Hex package, generate and include the checksum file:

mix rustler_precompiled.download MermaidValidator --all --print

About

rust nif to validate mermaid format

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages