linemd
is a simple, no deps, markdown parser and renderer.
html
and svg
features enabled respectively
html
feature is enabledcargo install linemd
nix profile install github:yusdacra/linemd
nix run install github:yusdacra/linemd
nix-env -i -f "https://github.com/yusdacra/linemd/tarball/master"
```rust let md: String;
let tokens = linemd::parse(md); // use tokens however you want ```
You can also render as HTML (needs html
feature enabled):
```rust
let parsed_tokens: Vec
let html = linemd::renderashtml(parsed_tokens); ```
Or SVG (needs svg
feature enabled):
```rust
let parsed_tokens: Vec
let svg = linemd::renderassvg(parsed_tokens); ```
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.