diff options
| author | Philipp A | 2020-10-25 17:46:51 +0100 | 
|---|---|---|
| committer | Philipp A | 2020-10-25 17:46:51 +0100 | 
| commit | 126dc6cfddf91c4cdac2b7d4cfb961019f3c6784 (patch) | |
| tree | de3e7c65c9c8e329a3b08342c4c2e2762aadffff /renderer/src/html.rs | |
| parent | b0c55246570b9c04e732eee43e6c02d6f3a043a4 (diff) | |
| download | rust-rst-126dc6cfddf91c4cdac2b7d4cfb961019f3c6784.tar.bz2 | |
Initial options impl
Diffstat (limited to 'renderer/src/html.rs')
| -rw-r--r-- | renderer/src/html.rs | 8 | 
1 files changed, 6 insertions, 2 deletions
| diff --git a/renderer/src/html.rs b/renderer/src/html.rs index bb7c42e..3dab74e 100644 --- a/renderer/src/html.rs +++ b/renderer/src/html.rs @@ -6,6 +6,7 @@ use std::io::Write;  use failure::Error;  // use crate::url::Url; +use crate::opt::{RenderOptionsStandalone, RenderOptionsStandaloneBuilder};  use document_tree::{  	Document,Element,HasChildren,ExtraAttributes,  	elements as e, @@ -17,9 +18,12 @@ use document_tree::{  // static FOOTNOTE_SYMBOLS: [char; 10] = ['*', '†', '‡', '§', '¶', '#', '♠', '♥', '♦', '♣']; -pub fn render_html<W>(document: &Document, stream: W, standalone: bool) -> Result<(), Error> where W: Write { +pub fn render_html<W, O>(document: &Document, stream: W, opts: O) -> Result<(), Error> +	where W: Write, O: Into<RenderOptionsStandalone> +{  	let mut renderer = HTMLRenderer { stream, level: 0 }; -	if standalone { +	let opts = opts.into(); +	if opts.standalone() {  		document.render_html(&mut renderer)  	} else {  		for c in document.children() { | 
