aboutsummaryrefslogtreecommitdiffstats
path: root/src/renderer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderer.rs')
-rw-r--r--src/renderer.rs23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/renderer.rs b/src/renderer.rs
index 0b13441..9e51eb4 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -1 +1,22 @@
-pub static FOOTNOTE_SYMBOLS: [char; 10] = ['*', '†', '‡', '§', '¶', '#', '♠', '♥', '♦', '♣'];
+mod html;
+
+
+use std::io::Write;
+
+use failure::Error;
+
+use crate::document_tree::Document;
+
+
+pub fn render_json<W>(document: &Document, stream: W) -> Result<(), Error> where W: Write {
+ serde_json::to_writer(stream, &document)?;
+ Ok(())
+}
+
+pub fn render_xml<W>(document: &Document, stream: W) -> Result<(), Error> where W: Write {
+ serde_xml_rs::to_writer(stream, &document).map_err(failure::SyncFailure::new)?;
+ Ok(())
+}
+
+pub use html::render_html;
+