extract-frontmatter
Overview
A Rust library that allows a user to extract an arbitrary number of lines of "front-matter" from the start of any multiline string.
Note that absolutely no parsing of extracted front-matter is performed; this is designed to output its results for another library to then parse.
Versioning
This project follows Semantic Versioning principals starting with v1.0.0
Repository information
This repository is located on GitLab.com.
Usage
Example 1 (Markdown with TOML)
Input:
[meta]
field_one = 10
field_two = [2, 4]
+++
This is an example markdown document that contains the following TOML front-matter:
Code:
Front-matter output:
[]
= 10
= [2, 4]
Data output:
This is an example markdown document that contains the following TOML front-matter:
Example 2 (SQL with YAML)
Input:
-- meta:
-- field_one: 10
-- field_two:
-- - 2
-- - 4
SELECT version;
Code:
Front-matter output:
meta:
field_one: 10
field_two:
- 2
- 4
Data output:
SELECT version;