aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-05-12 23:04:28 +0000
committerFuwn <[email protected]>2022-05-12 23:04:28 +0000
commitc2d10eab138c7ab74d4a4ac154066427d8a32f69 (patch)
tree39b487baf182df80981d37b1aebf1742082a28c0 /examples
parentfeat(0.1.0): initial release (diff)
downloadgerm-c2d10eab138c7ab74d4a4ac154066427d8a32f69.tar.xz
germ-c2d10eab138c7ab74d4a4ac154066427d8a32f69.zip
chore(examples): write convert to file
Diffstat (limited to 'examples')
-rw-r--r--examples/html.rs11
-rw-r--r--examples/markdown.rs13
2 files changed, 9 insertions, 15 deletions
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");
}