summaryrefslogtreecommitdiff
path: root/src/metadata.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/metadata.rs')
-rw-r--r--src/metadata.rs23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/metadata.rs b/src/metadata.rs
index 9f25621..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.
@@ -176,7 +176,8 @@ pub struct Metadata {
basedir: PathBuf,
title: String,
date: Option<String>,
- markdown_filename: PathBuf,
+ authors: Option<Vec<String>>,
+ markdown_filenames: Vec<PathBuf>,
bindings_filenames: Vec<PathBuf>,
bindings: Bindings,
impls: HashMap<String, DocumentImpl>,
@@ -234,7 +235,8 @@ impl Metadata {
basedir: basedir.as_ref().to_path_buf(),
title: yaml.title().into(),
date: yaml.date().map(|s| s.into()),
- markdown_filename: yaml.markdown().into(),
+ authors: yaml.authors().map(|a| a.into()),
+ markdown_filenames: yaml.markdowns().into(),
bindings_filenames,
bindings,
impls,
@@ -261,14 +263,19 @@ impl Metadata {
self.date = Some(date);
}
+ /// Authors.
+ pub fn authors(&self) -> Option<&[String]> {
+ self.authors.as_deref()
+ }
+
/// Return base dir for all relative filenames.
pub fn basedir(&self) -> &Path {
&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.