summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers+gitlab@digital-scurf.org>2022-11-01 22:45:58 +0000
committerDaniel Silverstone <dsilvers+gitlab@digital-scurf.org>2022-11-01 22:45:58 +0000
commit0d2ab1a2686f1abc624e61b1331d3fce78e31002 (patch)
tree8f2f231a6263e9607a26602202054842990cd361
parenta08abe207e5ce14d0f820a7af31eafa35f1b47f5 (diff)
parent9caf9bb6263299456ae8969527d66f072e584a03 (diff)
downloadsubplot-0d2ab1a2686f1abc624e61b1331d3fce78e31002.tar.gz
Merge branch 'liw/authors' into 'main'
feat! subplot metadata field for authors Closes #239 See merge request subplot/subplot!298
-rw-r--r--examples/seq/seq.subplot3
-rw-r--r--src/ast.rs10
-rw-r--r--subplot.md11
-rw-r--r--subplot.subplot3
-rw-r--r--tests/subplots/common/files.subplot3
-rw-r--r--tests/subplots/common/runcmd.subplot3
6 files changed, 23 insertions, 10 deletions
diff --git a/examples/seq/seq.subplot b/examples/seq/seq.subplot
index a6a6219..3bea683 100644
--- a/examples/seq/seq.subplot
+++ b/examples/seq/seq.subplot
@@ -1,5 +1,6 @@
title: "**seq**(1) acceptance tests"
-author: The Subplot project
+authors:
+ - The Subplot project
markdowns:
- seq.md
bindings:
diff --git a/src/ast.rs b/src/ast.rs
index ceded5c..15843eb 100644
--- a/src/ast.rs
+++ b/src/ast.rs
@@ -285,7 +285,7 @@ pub enum Error {
pub struct YamlMetadata {
title: String,
subtitle: Option<String>,
- author: Option<String>,
+ authors: Option<Vec<String>>,
date: Option<String>,
classes: Option<Vec<String>>,
bibliography: Option<Vec<PathBuf>>,
@@ -320,8 +320,12 @@ impl YamlMetadata {
map.insert("subtitle".into(), meta_string(v));
}
- if let Some(v) = &self.author {
- map.insert("author".into(), meta_string(v));
+ if let Some(authors) = &self.authors {
+ let authors: Vec<MetaValue> = authors
+ .iter()
+ .map(|s| MetaValue::MetaString(s.into()))
+ .collect();
+ map.insert("author".into(), MetaValue::MetaList(authors));
}
if let Some(v) = &self.date {
diff --git a/subplot.md b/subplot.md
index 2d494b3..0901133 100644
--- a/subplot.md
+++ b/subplot.md
@@ -637,7 +637,8 @@ they are how Pandoc recongizes the block.
~~~{.yaml .numberLines}
---
title: "Subplot"
-author: The Subplot project
+authors:
+- The Subplot project
date: work in progress
bindings:
- subplot.yaml
@@ -2449,7 +2450,9 @@ and file metadate.html contains "WIP"
~~~{#metadate.subplot .file .yaml .numberLines}
title: The Fabulous Title
-author: Alfred Pennyworth and Geoffrey Butler
+authors:
+- Alfred Pennyworth
+- Geoffrey Butler
date: WIP
markdowns:
- metadate.md
@@ -2478,7 +2481,9 @@ and file dateoption.html contains "FANCYDATE"
~~~{#dateless.subplot .file .yaml .numberLines}
title: The Fabulous Title
-author: Alfred Pennyworth and Geoffrey Butler
+authors:
+- Alfred Pennyworth
+- Geoffrey Butler
markdowns:
- dateless.md
~~~
diff --git a/subplot.subplot b/subplot.subplot
index 61ecd4f..e109430 100644
--- a/subplot.subplot
+++ b/subplot.subplot
@@ -1,5 +1,6 @@
title: "Subplot"
-author: The Subplot project
+authors:
+ - The Subplot project
markdowns:
- subplot.md
bindings:
diff --git a/tests/subplots/common/files.subplot b/tests/subplots/common/files.subplot
index edf7a26..75726f9 100644
--- a/tests/subplots/common/files.subplot
+++ b/tests/subplots/common/files.subplot
@@ -1,5 +1,6 @@
title: Acceptance criteria for the files Subplot library
-author: The Subplot project
+authors:
+ - The Subplot project
markdowns:
- files.md
bindings:
diff --git a/tests/subplots/common/runcmd.subplot b/tests/subplots/common/runcmd.subplot
index e30e5a8..dcfd590 100644
--- a/tests/subplots/common/runcmd.subplot
+++ b/tests/subplots/common/runcmd.subplot
@@ -1,5 +1,6 @@
title: Acceptance criteria for the lib/runcmd Subplot library
-author: The Subplot project
+authors:
+ - The Subplot project
markdowns:
- runcmd.md
bindings: