summaryrefslogtreecommitdiff
path: root/src/doc.rs
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers+gitlab@digital-scurf.org>2023-02-01 23:49:11 +0000
committerDaniel Silverstone <dsilvers+gitlab@digital-scurf.org>2023-02-01 23:49:11 +0000
commitb6df0fa5b7046bad97f63dc928a9776cecaee623 (patch)
tree7f2fe57569bdf9d77d0bc30e3fac78ba2d32ff92 /src/doc.rs
parente1d63019fdd6f0d24703197b6a6029f26e6f089f (diff)
parentb160ad5b9f0e38859b0a6d3c3262afbb39067584 (diff)
downloadsubplot-b6df0fa5b7046bad97f63dc928a9776cecaee623.tar.gz
Merge branch 'liw/refactor-md' into 'main'
improve Markdown API See merge request subplot/subplot!307
Diffstat (limited to 'src/doc.rs')
-rw-r--r--src/doc.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/doc.rs b/src/doc.rs
index a39ab99..faa3a84 100644
--- a/src/doc.rs
+++ b/src/doc.rs
@@ -13,7 +13,6 @@ use crate::{Metadata, YamlMetadata};
use crate::{Warning, Warnings};
use std::collections::HashSet;
-use std::convert::TryFrom;
use std::default::Default;
use std::fmt::Debug;
use std::fs::read;
@@ -105,7 +104,7 @@ impl Document {
subplot: PathBuf,
markdowns: Vec<PathBuf>,
yamlmeta: &YamlMetadata,
- mut md: Markdown,
+ md: Markdown,
style: Style,
template: Option<&str>,
) -> Result<Document, SubplotError>
@@ -147,7 +146,7 @@ impl Document {
let mdfile = meta.markdown();
let mdfile = basedir.join(mdfile);
- let mut md = Markdown::try_from(mdfile.as_path())?;
+ let mut md = Markdown::load_file(mdfile.as_path())?;
md.set_metadata(&meta);
let markdowns = vec![mdfile];