Use it
# Cargo.toml — not on crates.io yet, so pull it straight from the repo
[dependencies]
velq-core = { git = "https://github.com/iKora128/velq" }Write, validate, read
use std::path::Path;
use velq_core::{pack, read_manifest, validate, Asset, Manifest};
let manifest = Manifest { title: "Q3 report".into(), ..Manifest::default() };
let assets = [Asset {
path: "assets/css/main.css".into(),
bytes: b"body{margin:2rem}".to_vec(),
}];
pack(Path::new("report.velq"), &manifest, b"<h1>Q3</h1>", &assets)?;
validate(Path::new("report.velq"))?; // manifest.json + index.html: ok
let title = read_manifest(Path::new("report.velq"))?.title;The whole API
pack / pack_mdWrite a package — HTML-only, or Markdown source plus its rendered HTML.
validateThe two-entry check: is this ZIP a .velq?
read_manifest / read_index_md / read_file_bytes / read_assetsRead metadata, the Markdown source, or any entry.
update_index / update_mdReplace the document, keep manifest and assets — written atomically, so a crash never corrupts the package.
unpackExtract everything to a folder (the .zip escape hatch, as a function).