From 1f17bef1102f4fec92f1ced4890d5e77300a8f28 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Sun, 27 Nov 2022 22:02:57 -0500 Subject: lib/xesite_markdown: add xesite markdown to HTML tool Signed-off-by: Xe Iaso --- lib/xesite_markdown/src/bin/xemd2html.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/xesite_markdown/src/bin/xemd2html.rs diff --git a/lib/xesite_markdown/src/bin/xemd2html.rs b/lib/xesite_markdown/src/bin/xemd2html.rs new file mode 100644 index 0000000..6e54ab2 --- /dev/null +++ b/lib/xesite_markdown/src/bin/xemd2html.rs @@ -0,0 +1,15 @@ +use color_eyre::eyre::Result; +use std::io::{prelude::*, stdin, stdout}; + +fn main() -> Result<()> { + let mut input = String::new(); + let mut fin = stdin().lock(); + fin.read_to_string(&mut input)?; + + let result = xesite_markdown::render(&input)?; + + let mut fout = stdout().lock(); + fout.write(result.as_bytes())?; + + Ok(()) +} -- cgit v1.2.3