summaryrefslogtreecommitdiff
path: root/src/doc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc.rs')
-rw-r--r--src/doc.rs21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/doc.rs b/src/doc.rs
index d6ab697..db37389 100644
--- a/src/doc.rs
+++ b/src/doc.rs
@@ -161,6 +161,11 @@ impl<'a> Document {
style: Style,
template: Option<&str>,
) -> Result<Document> {
+ trace!(
+ "Document::from_file: basedir={} filename={}",
+ basedir.display(),
+ filename.display()
+ );
let markdowns = vec![filename.to_path_buf()];
let mut pandoc = pandoc::new();
@@ -180,6 +185,7 @@ impl<'a> Document {
pandoc::PandocOutput::ToBuffer(o) => o,
_ => return Err(SubplotError::NotJson),
};
+ trace!("Pandoc was happy");
let doc = Document::from_json(basedir, markdowns, &output, style, template)?;
trace!("Loaded document OK");
Ok(doc)
@@ -223,7 +229,7 @@ impl<'a> Document {
///
/// The sources are any files that affect the output so that if
/// the source file changes, the output needs to be re-generated.
- pub fn sources(&mut self, template: Option<&str>) -> Vec<PathBuf> {
+ pub fn sources(&mut self, template: &Option<String>) -> Vec<PathBuf> {
let mut names = vec![];
for x in self.meta().bindings_filenames() {
@@ -352,7 +358,10 @@ impl<'a> Document {
if matches!(step.types().get(name.as_str()), Some(CaptureType::File))
&& !filenames.contains(&text.to_lowercase())
{
- self.warnings.push(Warning::UnknownEmbeddedFile(text.to_string()));
+ self.warnings.push(Warning::UnknownEmbeddedFile(
+ scenario.title().to_string(),
+ text.to_string(),
+ ));
okay = false;
}
}
@@ -386,7 +395,8 @@ impl<'a> Document {
}
}
for filename in filenames.iter() {
- self.warnings.push(Warning::UnusedEmbeddedFile(filename.to_string()));
+ self.warnings
+ .push(Warning::UnusedEmbeddedFile(filename.to_string()));
}
// We always succeed. Subplot's own subplot had valid cases of
@@ -410,7 +420,10 @@ impl<'a> Document {
for step in scenario.steps() {
if step.function().is_none() {
trace!("Missing step implementation: {:?}", step.text());
- self.warnings.push(Warning::MissingStepImplementation(step.text().to_string()));
+ self.warnings.push(Warning::MissingStepImplementation(
+ scenario.title().to_string(),
+ step.text().to_string(),
+ ));
okay = false;
}
}