summaryrefslogtreecommitdiff
path: root/src/metadata.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2023-05-10 09:10:25 +0300
committerLars Wirzenius <liw@liw.fi>2023-05-10 09:14:34 +0300
commitace211d2c2e9c775872c4a23087763afff5a5bb2 (patch)
treef6884f4b6c3ee43c9c736f7f91e12d8a5ec98c49 /src/metadata.rs
parent0a81c16df535853c68d5c833a213a81c2a1a9388 (diff)
downloadsubplot-ace211d2c2e9c775872c4a23087763afff5a5bb2.tar.gz
feat! allow multiple markdown files for a subplot
Sponsored-by: author
Diffstat (limited to 'src/metadata.rs')
-rw-r--r--src/metadata.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/metadata.rs b/src/metadata.rs
index d569b40..e4d3d53 100644
--- a/src/metadata.rs
+++ b/src/metadata.rs
@@ -63,9 +63,9 @@ impl YamlMetadata {
Ok(meta)
}
- /// Name of file with the Markdown for the subplot document.
- pub fn markdown(&self) -> &Path {
- &self.markdowns[0]
+ /// Names of files with the Markdown for the subplot document.
+ pub fn markdowns(&self) -> &[PathBuf] {
+ &self.markdowns
}
/// Title.
@@ -177,7 +177,7 @@ pub struct Metadata {
title: String,
date: Option<String>,
authors: Option<Vec<String>>,
- markdown_filename: PathBuf,
+ markdown_filenames: Vec<PathBuf>,
bindings_filenames: Vec<PathBuf>,
bindings: Bindings,
impls: HashMap<String, DocumentImpl>,
@@ -236,7 +236,7 @@ impl Metadata {
title: yaml.title().into(),
date: yaml.date().map(|s| s.into()),
authors: yaml.authors().map(|a| a.into()),
- markdown_filename: yaml.markdown().into(),
+ markdown_filenames: yaml.markdowns().into(),
bindings_filenames,
bindings,
impls,
@@ -273,9 +273,9 @@ impl Metadata {
&self.basedir
}
- /// Return filename of the markdown file.
- pub fn markdown_filename(&self) -> &Path {
- &self.markdown_filename
+ /// Return filenames of the markdown files.
+ pub fn markdown_filenames(&self) -> &[PathBuf] {
+ &self.markdown_filenames
}
/// Return filename where bindings are specified.