summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2023-07-02 19:29:05 +0300
committerLars Wirzenius <liw@liw.fi>2023-07-02 19:29:05 +0300
commitb98e4e25c1ad67381f58432f8b29279a9e7dcb04 (patch)
treed3cda2105363a76d5ca0841763a946aff2b0837d /src
parente5e0a4a3cb035bf0bace9487a182478f4fff20d0 (diff)
downloadsubplot-b98e4e25c1ad67381f58432f8b29279a9e7dcb04.tar.gz
feat! drop support for bibliographies in document metadata
We don't use the bibliographies for anything so there's not point in allowing users to specify it. If and when we add support for bibliographies again, we may well want to do it in a different way. Alas, we also have to disable reference.md because the release it refers to uses bibliographies. We'll have to re-enable it again after the next release. Sponsored-by: author
Diffstat (limited to 'src')
-rw-r--r--src/bin/cli/mod.rs10
-rw-r--r--src/doc.rs4
-rw-r--r--src/metadata.rs26
3 files changed, 0 insertions, 40 deletions
diff --git a/src/bin/cli/mod.rs b/src/bin/cli/mod.rs
index 19e4fbf..30ad5f6 100644
--- a/src/bin/cli/mod.rs
+++ b/src/bin/cli/mod.rs
@@ -27,7 +27,6 @@ pub struct Metadata {
title: String,
binding_files: Vec<String>,
impls: HashMap<String, Vec<String>>,
- bibliographies: Vec<String>,
scenarios: Vec<String>,
files: Vec<String>,
}
@@ -64,13 +63,6 @@ impl TryFrom<&mut Document> for Metadata {
(template.to_string(), filenames)
})
.collect();
- let mut bibliographies: Vec<_> = doc
- .meta()
- .bibliographies()
- .into_iter()
- .map(|p| filename(Some(p)))
- .collect();
- bibliographies.sort_unstable();
let mut scenarios: Vec<_> = doc
.scenarios()?
.into_iter()
@@ -88,7 +80,6 @@ impl TryFrom<&mut Document> for Metadata {
title,
binding_files,
impls,
- bibliographies,
scenarios,
files,
})
@@ -109,7 +100,6 @@ impl Metadata {
for (template, filenames) in self.impls.iter() {
Self::write_list(filenames, &format!("functions[{template}]"));
}
- Self::write_list(&self.bibliographies, "bibliography");
Self::write_list(&self.files, "file");
Self::write_list(&self.scenarios, "scenario");
}
diff --git a/src/doc.rs b/src/doc.rs
index d417e1d..e448051 100644
--- a/src/doc.rs
+++ b/src/doc.rs
@@ -228,10 +228,6 @@ impl Document {
}
}
- for x in self.meta().bibliographies().iter() {
- names.push(PathBuf::from(x))
- }
-
for name in self.meta().markdown_filenames() {
names.push(name.into());
}
diff --git a/src/metadata.rs b/src/metadata.rs
index 263e13e..e3463b3 100644
--- a/src/metadata.rs
+++ b/src/metadata.rs
@@ -45,7 +45,6 @@ pub struct YamlMetadata {
authors: Option<Vec<String>>,
date: Option<String>,
classes: Option<Vec<String>>,
- bibliography: Option<Vec<PathBuf>>,
markdowns: Vec<PathBuf>,
bindings: Option<Vec<PathBuf>>,
documentclass: Option<String>,
@@ -100,11 +99,6 @@ impl YamlMetadata {
&self.impls
}
- /// Bibliographies.
- pub fn bibliographies(&self) -> Option<&[PathBuf]> {
- self.bibliography.as_deref()
- }
-
/// Classes..
pub fn classes(&self) -> Option<&[String]> {
self.classes.as_deref()
@@ -132,9 +126,6 @@ impls:
python:
- foo.py
- bar.py
-bibliography:
-- foo.bib
-- bar.bib
markdowns:
- test.md
bindings:
@@ -146,10 +137,6 @@ bindings:
assert_eq!(meta.title, "Foo Bar");
assert_eq!(meta.date.unwrap(), "today");
assert_eq!(meta.classes.unwrap(), &["json", "text"]);
- assert_eq!(
- meta.bibliography.unwrap(),
- &[path("foo.bib"), path("bar.bib")]
- );
assert_eq!(meta.markdowns, vec![Path::new("test.md")]);
assert_eq!(
meta.bindings.unwrap(),
@@ -178,7 +165,6 @@ pub struct Metadata {
bindings_filenames: Vec<PathBuf>,
bindings: Bindings,
impls: HashMap<String, DocumentImpl>,
- bibliographies: Vec<PathBuf>,
/// Extra class names which should be considered 'correct' for this document
classes: Vec<String>,
}
@@ -216,12 +202,6 @@ impl Metadata {
impls.insert(impl_name.to_string(), docimpl);
}
- let bibliographies = if let Some(v) = yaml.bibliographies() {
- v.iter().map(|s| s.to_path_buf()).collect()
- } else {
- vec![]
- };
-
let classes = if let Some(v) = yaml.classes() {
v.iter().map(|s| s.to_string()).collect()
} else {
@@ -237,7 +217,6 @@ impl Metadata {
bindings_filenames,
bindings,
impls,
- bibliographies,
classes,
};
trace!("metadata: {:#?}", meta);
@@ -295,11 +274,6 @@ impl Metadata {
&self.bindings
}
- /// Return the bibliographies.
- pub fn bibliographies(&self) -> Vec<&Path> {
- self.bibliographies.iter().map(|x| x.as_path()).collect()
- }
-
/// The classes which this document also claims are valid
pub fn classes(&self) -> impl Iterator<Item = &str> {
self.classes.iter().map(Deref::deref)