[−][src]Crate extract_frontmatter
A 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.
Usage
To use this library:
- Instantiate an instance of
Extractor - Call a selector method on it
- Call zero or more modifier methods on it
- Call
extract()orcollect()on it
Example
Given a variable input with the following text:
root:
child1: true
child2: two
---
# Example
This is an example Markdown file.
... and the following code:
use extract_frontmatter::Extractor; let mut extractor = Extractor::new(input); extractor.select_by_terminator("---"); let output: String = extractor.extract();
... the variable output will contain:
root:
child1: true
child2: two
Structs
| Extractor | Extracts front-matter depending on how it is configured. |