diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-16 16:49:29 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-16 16:49:53 +0200 |
commit | 6ee90b34c87354baf8e03d5469a92cf5dd17a82b (patch) | |
tree | cfa64be772be6464e6f790dabccf8a77e7afe60e /examples | |
parent | 93d0b7c6465f4ffe220b3ddada729746b11eb6ce (diff) | |
download | markdown-rs-6ee90b34c87354baf8e03d5469a92cf5dd17a82b.tar.gz markdown-rs-6ee90b34c87354baf8e03d5469a92cf5dd17a82b.tar.bz2 markdown-rs-6ee90b34c87354baf8e03d5469a92cf5dd17a82b.zip |
Add support for frontmatter
Diffstat (limited to 'examples')
-rw-r--r-- | examples/lib.rs | 17 |
1 files changed, 16 insertions, 1 deletions
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() + } + ) + ); } |