diff options
author | Daniel Silverstone <dsilvers+gitlab@digital-scurf.org> | 2023-06-15 19:17:47 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers+gitlab@digital-scurf.org> | 2023-06-15 19:17:47 +0000 |
commit | 39601b16c513fe3f1f60cb260fae2e046f7eadaf (patch) | |
tree | 04020c865c252db7421feae078981df00e3b3b9c | |
parent | b405eacf918be3792ea791900d2f4d2c2bcd4367 (diff) | |
parent | 8802069892c3835181cb506d0deba91eacce225a (diff) | |
download | subplot-39601b16c513fe3f1f60cb260fae2e046f7eadaf.tar.gz |
Merge branch 'liw/chore' into 'main'
deal with a couple of FIXMEs
See merge request subplot/subplot!342
-rw-r--r-- | src/bin/subplot.rs | 2 | ||||
-rw-r--r-- | src/doc.rs | 4 | ||||
-rw-r--r-- | src/md.rs | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/src/bin/subplot.rs b/src/bin/subplot.rs index ca1ef5d..ced34cc 100644 --- a/src/bin/subplot.rs +++ b/src/bin/subplot.rs @@ -285,7 +285,7 @@ impl Docgen { }; doc.typeset(&mut Warnings::default()); - std::fs::write(&self.output, doc.to_html(&date)) + std::fs::write(&self.output, doc.to_html(&date)?) .map_err(|e| SubplotError::WriteFile(self.output.clone(), e))?; Ok(()) @@ -153,7 +153,7 @@ impl Document { } /// Return Document as an HTML page serialized into HTML text - pub fn to_html(&mut self, date: &str) -> String { + pub fn to_html(&mut self, date: &str) -> Result<String, SubplotError> { let mut head = Element::new(crate::html::ElementTag::Head); let mut title = Element::new(crate::html::ElementTag::Title); title.push_child(crate::html::Content::Text(self.meta().title().into())); @@ -166,7 +166,7 @@ impl Document { body.push_child(Content::Elt(md.root_element().clone())); } let page = HtmlPage::new(head, body); - page.serialize().unwrap() // FIXME + page.serialize().map_err(SubplotError::ParseMarkdown) } fn typeset_meta(&self) -> Element { @@ -141,7 +141,6 @@ impl Markdown { } /// Find embedded files. - // FIXME: this should return a result pub fn embedded_files(&self) -> Result<EmbeddedFiles, MdError> { let mut files = EmbeddedFiles::default(); @@ -378,7 +377,6 @@ mod typeset { fn typeset_pikchr(e: &Element) -> Result<Element, SubplotError> { let markup = e.content(); - // FIXME: is there ever a need to use classes other than .pikchr? let svg = PikchrMarkup::new(&markup, None).as_svg()?; Ok(svg_to_element(svg)) } |