From c2d10eab138c7ab74d4a4ac154066427d8a32f69 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 12 May 2022 23:04:28 +0000 Subject: chore(examples): write convert to file --- .gitignore | 4 ++++ examples/html.rs | 11 ++++------- examples/markdown.rs | 13 +++++-------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 33adfcb..dc6c081 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ Cargo.lock # IDE .idea/ + +# Artifacts +examples/*.md +examples/*.html diff --git a/examples/html.rs b/examples/html.rs index 00d62ed..5e1821d 100644 --- a/examples/html.rs +++ b/examples/html.rs @@ -46,15 +46,12 @@ This is more text after a blank line. That was a link without text."#; fn main() { - println!( - "{}", - // germ::convert::convert_from_ast( - // germ::ast::build(EXAMPLE_GEMTEXT), - // germ::convert::Target::Markdown - // ) + std::fs::write( + "examples/convert.html", germ::convert::convert_from_string( EXAMPLE_GEMTEXT, germ::convert::Target::HTML, ), - ); + ) + .expect("could not write to file"); } diff --git a/examples/markdown.rs b/examples/markdown.rs index 800717b..a3ba61f 100644 --- a/examples/markdown.rs +++ b/examples/markdown.rs @@ -46,15 +46,12 @@ This is more text after a blank line. That was a link without text."#; fn main() { - println!( - "{}", - // germ::convert::convert_from_ast( - // germ::ast::build(EXAMPLE_GEMTEXT), - // germ::convert::Target::Markdown - // ) + std::fs::write( + "examples/convert.md", germ::convert::convert_from_string( EXAMPLE_GEMTEXT, - germ::convert::Target::Markdown + germ::convert::Target::Markdown, ), - ); + ) + .expect("could not write to file"); } -- cgit v1.2.3