#markdown-parser #markdown-html #markdown #html #svg #parser #html-rendering

bin+lib linemd

A simple and opinionated markdown parser (and renderer) written in Rust

6 releases (3 breaking)

0.4.0 Jun 27, 2021
0.3.0 Jun 16, 2021
0.2.1 Jun 15, 2021
0.1.1 Mar 14, 2021
0.1.0 Feb 16, 2021

#2923 in Parser implementations

MIT license

44KB
1K SLoC

crates.io docs.rs

linemd

linemd is a simple, no dependencies, markdown parser and renderer.

Features

  • No dependencies.
  • Does not depend on std, only depends on alloc and core.
  • No allocations while parsing; only allocation is done to store the tokens (unless you provide your own preallocated Vec).
  • Can render to HTML and SVG; they need html and svg features enabled respectively.
    • By default, html feature is enabled.
  • 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
    • Non-flakes: nix-env -i -f "https://github.com/yusdacra/linemd/tarball/master"

Usage

See the library documentation for library usage.

CLI usage:

renders a markdown file

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.

No runtime deps

Features