aboutsummaryrefslogtreecommitdiffstats
path: root/examples/lib.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-16 16:49:29 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-16 16:49:53 +0200
commit6ee90b34c87354baf8e03d5469a92cf5dd17a82b (patch)
treecfa64be772be6464e6f790dabccf8a77e7afe60e /examples/lib.rs
parent93d0b7c6465f4ffe220b3ddada729746b11eb6ce (diff)
downloadmarkdown-rs-6ee90b34c87354baf8e03d5469a92cf5dd17a82b.tar.gz
markdown-rs-6ee90b34c87354baf8e03d5469a92cf5dd17a82b.tar.bz2
markdown-rs-6ee90b34c87354baf8e03d5469a92cf5dd17a82b.zip
Add support for frontmatter
Diffstat (limited to 'examples/lib.rs')
-rw-r--r--examples/lib.rs17
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()
+ }
+ )
+ );
}