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

#2469 in Parser implementations

Download history 479/week @ 2024-07-22 920/week @ 2024-07-29 897/week @ 2024-08-05 952/week @ 2024-08-12 2179/week @ 2024-08-19 1775/week @ 2024-08-26 2702/week @ 2024-09-02 1666/week @ 2024-09-09 1031/week @ 2024-09-16 743/week @ 2024-09-23 1035/week @ 2024-09-30 755/week @ 2024-10-07 2862/week @ 2024-10-14 646/week @ 2024-10-21 859/week @ 2024-10-28 525/week @ 2024-11-04

5,044 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–3MB
~54K SLoC