From 6ee90b34c87354baf8e03d5469a92cf5dd17a82b Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Tue, 16 Aug 2022 16:49:29 +0200 Subject: Add support for frontmatter --- examples/lib.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'examples/lib.rs') diff --git a/examples/lib.rs b/examples/lib.rs index b1869bb..94c2c58 100644 --- a/examples/lib.rs +++ b/examples/lib.rs @@ -1,5 +1,5 @@ extern crate micromark; -use micromark::{micromark, micromark_with_options, Options}; +use micromark::{micromark, micromark_with_options, Constructs, Options}; fn main() { // Turn on debugging. @@ -21,4 +21,19 @@ fn main() { } ) ); + + // Support extensions that are not in CommonMark. + println!( + "{:?}", + micromark_with_options( + "---\ntitle: Neptune\n---\nSome stuff on the moons of Neptune.", + &Options { + constructs: Constructs { + frontmatter: true, + ..Constructs::default() + }, + ..Options::default() + } + ) + ); } -- cgit