Skip to main content

markdown/
markdown.rs

1#[cfg(feature = "markdown")]
2fn main() {
3    let html = std::fs::read_to_string("examples/recipe.html").unwrap();
4    let recipe = reget::parse_recipe(&html).unwrap();
5    let md = recipe
6        .to_markdown()
7        .with_url("https://example.org/recipe")
8        .with_ingredient_section("Zutaten")
9        .with_default_section("Zubereitung")
10        .convert();
11    println!("{md}");
12}
13
14#[cfg(not(feature = "markdown"))]
15fn main() {
16    eprintln!(
17        "This example requires the 'markdown' feature. Try `cargo run --features markdown --example markdown`"
18    );
19}