linemd
linemd is a simple, no deps, markdown parser and renderer.
Features
- No deps
- Can render to HTML and SVG; they need
htmlandsvgfeatures enabled respectively- By default,
htmlfeature is enabled
- By default,
- Comes with a CLI utility for rendering to HTML or SVG
Install
- Cargo:
cargo install linemd - Nix:
- Flakes:
nix profile install github:yusdacra/linemd- Or run without installing:
nix run install github:yusdacra/linemd
- Or run without installing:
- Non-flakes:
nix-env -i -f "https://github.com/yusdacra/linemd/tarball/master"
- Flakes:
Usage
let md: String;
let tokens = parse;
// use tokens however you want
You can also render as HTML (needs html feature enabled):
let parsed_tokens: ;
let html = render_as_html;
Or SVG (needs svg feature enabled):
let parsed_tokens: ;
let svg = render_as_svg;
CLI usage:
renders a markdown file as HTML
usage:
linemd FILE Reads from file
linemd - Reads from stdin
options:
-h, --help Prints this text
-S, --svg Renders to SVG instead of HTML
exit codes:
0 Everything was successful
1 Failed to read the given file
2 Failed to read from stdin
Also see examples directory.