summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers+gitlab@digital-scurf.org>2023-06-15 19:17:47 +0000
committerDaniel Silverstone <dsilvers+gitlab@digital-scurf.org>2023-06-15 19:17:47 +0000
commit39601b16c513fe3f1f60cb260fae2e046f7eadaf (patch)
tree04020c865c252db7421feae078981df00e3b3b9c
parentb405eacf918be3792ea791900d2f4d2c2bcd4367 (diff)
parent8802069892c3835181cb506d0deba91eacce225a (diff)
downloadsubplot-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.rs2
-rw-r--r--src/doc.rs4
-rw-r--r--src/md.rs2
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(())
diff --git a/src/doc.rs b/src/doc.rs
index e218020..6fbf497 100644
--- a/src/doc.rs
+++ b/src/doc.rs
@@ -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 {
diff --git a/src/md.rs b/src/md.rs
index 0ea4cc3..b895528 100644
--- a/src/md.rs
+++ b/src/md.rs
@@ -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))
}