Xenapse is a small text-first diagram language and a Rust engine that compiles it.
You write a .xnp file (plus an optional .xcss stylesheet) and get one
self-contained, deterministic SVG: the same input gives the same bytes on every host.
A Xenapse diagram starts with an IMPORT declaring its module, then a body of
layout instructions. Two modules are built in:
| Module | Use |
|---|---|
FLOW |
Flowcharts — decisions, branches, loops |
MINDMAP |
Radial concept maps |
Flow example — decisions use < … >, steps use [ … ]:
IMPORT FLOW
START
< Is it ready? >
IF YES { [ Ship it ] } ELSE { [ Keep working ] }
END
Stylesheet — visual properties live in a separate .xcss file, keeping the
diagram source readable:
STYLESHEET "style.xcss"
IMPORT FLOW
START
[ Deploy ]
END
The full grammar, all XCSS properties, node shapes, and diagnostic codes are in
docs/DECISIONS.md (authoritative).
docs/blueprint.md has the design rationale.
Pre-built binaries for Linux and Windows are in releases/.
Verify the .sha256sum before use.
# Linux x86-64
unzip releases/xenapse-linux-x86_64.zip
./install.shOr build from source (no third-party dependencies, stable Rust required):
cargo build --release # → target/release/xenapsexenapse compile <input.xnp> [-o <out.svg>|-] [--style <file.xcss>]
xenapse check <input.xnp> [--style <file.xcss>]compilewrites<input stem>.svgnext to the input by default;-o -writes to stdout.checkruns the full pipeline and writes nothing — useful in CI.- Stylesheet precedence:
--style>STYLESHEET "path"directive > none. A missing file is an error. - Diagnostics go to stderr. Exit codes:
0success,1diagram errors,2usage/I/O error.
xenapse check examples/flow/support-ticket.xnp
xenapse compile examples/mindmap/release-plan.xnp -o release-plan.svgThe xenapse-core crate is filesystem-free: pass text in, get text out.
use xenapse_core::{compile, CompileOptions};
let source = "IMPORT FLOW\nSTART\n[ Hello ]\nEND\n";
let result = compile(source, None, &CompileOptions::default());
eprint!("{}", result.format_diagnostics());
if let Some(svg) = result.svg {
println!("{svg}");
}result.svg is None when any error diagnostic exists. result.elements maps every
node and edge back to its source span. Pass stylesheet text as the second argument;
use declared_stylesheet(source) to extract the STYLESHEET path for the host to load.
Xenapse registers two OS MIME types:
| Extension | Type | MIME |
|---|---|---|
.xnp |
Xenapse Diagram | application/vnd.xenapse.diagram |
.xcss |
Xenapse Stylesheet | text/vnd.xenapse.stylesheet |
Registration scripts and icons are under packaging/. See docs/file-types.md.
FLOW and MINDMAP modules, SVG output only. No editor, WASM target, PNG/PDF export. Xenapse Studio (a graphical editor) is planned separately.
