4 releases

0.1.0-alpha4 Jul 16, 2020
0.1.0-alpha3 Jul 15, 2020
0.1.0-alpha2 Feb 27, 2019
0.1.0-alpha1 Jan 5, 2019

#890 in Parser implementations

Download history 332/week @ 2023-11-20 603/week @ 2023-11-27 381/week @ 2023-12-04 279/week @ 2023-12-11 431/week @ 2023-12-18 219/week @ 2023-12-25 913/week @ 2024-01-01 1714/week @ 2024-01-08 2749/week @ 2024-01-15 2262/week @ 2024-01-22 1230/week @ 2024-01-29 1662/week @ 2024-02-05 2055/week @ 2024-02-12 1870/week @ 2024-02-19 1702/week @ 2024-02-26 2792/week @ 2024-03-04

8,520 downloads per month
Used in 5 crates

BSD-3-Clause

7KB
104 lines

Matter

CI Status Badge Crates.io Downloads Badge License Made by Fader

A universal frontmatter parser and extractor, written in Rust.

Installation

By default, matter is installed with support for TOML, YAML, and JSON frontmatter formats. However, you can override the defaults and install support for one specific format like so:

matter = { version = "0.1.0-alpha3", features = ["toml"] }

Usage

Once installed, you'll notice that Matter exports only a handful of functions. This is because it does most of the work for you. It also attempts to operate with minimal overhead, by only allocating as necessary.

let input = std::fs::read_to_string("./path/to/content.md").unwrap();
let Some((matter, content)) = matter::extract(&input).unwrap();

See the docs for more examples.

CLI

Matter is also distributed as a command line application. Install (cargo install matter --version 0.1.0-alpha3) and run to inspect any file's frontmatter:

matter path/to/content.md

License

Copyright 2018 Nicholas Young, All rights reserved. Released under a 3-Clause BSD License.

Dependencies

~2.1–3MB
~53K SLoC