From ff7bb08097797e4315a662b3f9e68d7c182264ce Mon Sep 17 00:00:00 2001 From: Martin Haug Date: Wed, 2 Oct 2024 12:12:09 +0200 Subject: [PATCH] Remove the `annote` field from the data model --- docs/file-format.md | 12 ++---------- src/csl/taxonomy.rs | 2 +- src/interop.rs | 12 ++++++------ src/lib.rs | 8 +------- tests/data/basic.yml | 2 +- 5 files changed, 11 insertions(+), 25 deletions(-) diff --git a/docs/file-format.md b/docs/file-format.md index 34899221..1ba334f9 100644 --- a/docs/file-format.md +++ b/docs/file-format.md @@ -187,14 +187,6 @@ This section lists all possible fields and data types for them. | **Description:** | Abstract of the item (e.g. the abstract of a journal article). | | **Example:** | `abstract: The dominant sequence transduction models are based on complex...` | -#### `annote` - -| | | -|------------------|-----------------------------------------------------------| -| **Data type:** | formattable string | -| **Description:** | Short markup, decoration, or annotation to the item (e.g., to indicate items included in a review). For descriptive text (e.g., in an annotated bibliography), use `note` instead. | -| **Example:** | `annote: The researchers at NYU explore in this paper ...` | - #### `genre` | | | @@ -360,8 +352,8 @@ This section lists all possible fields and data types for them. | | | |------------------|-----------------------------------------------------------| | **Data type:** | formattable string | -| **Description:** | additional description to be appended after reference list entry | -| **Example:** | `note: microfilm version` | +| **Description:** | short markup, decoration, or annotation to the item (e.g., to indicate items included in a review). | +| **Example:** | `microfilm version` | ### Data types diff --git a/src/csl/taxonomy.rs b/src/csl/taxonomy.rs index ebaa8b39..310093c7 100644 --- a/src/csl/taxonomy.rs +++ b/src/csl/taxonomy.rs @@ -232,7 +232,7 @@ impl EntryLike for Entry { .map(|f| f.select(form)) .map(Cow::Borrowed), StandardVariable::Annote => { - entry.map(|e| e.annote()).map(|f| f.select(form)).map(Cow::Borrowed) + entry.map(|e| e.note()).map(|f| f.select(form)).map(Cow::Borrowed) } StandardVariable::Archive => { entry.map(|e| e.archive()).map(|f| f.select(form)).map(Cow::Borrowed) diff --git a/src/interop.rs b/src/interop.rs index f5e5a06d..4cae3937 100644 --- a/src/interop.rs +++ b/src/interop.rs @@ -520,12 +520,16 @@ impl TryFrom<&tex::Entry> for Entry { } } + if let Some(note) = map_res(entry.note())?.map(Into::into) { + item.set_note(note); + } + if let Some(note) = map_res(entry.annotation())? .or_else(|| entry.addendum().ok()) - .map(|d| d.format_verbatim()) + .map(Into::into) { if item.note.is_none() { - item.set_note(note.into()); + item.set_note(note); } } @@ -533,10 +537,6 @@ impl TryFrom<&tex::Entry> for Entry { item.set_abstract_(abstract_.into()) } - if let Some(annote) = map_res(entry.annotation())? { - item.set_annote(annote.into()) - } - if let Some(series) = map_res(entry.series())? { let title: FormatString = series.into(); let mut new = Entry::new(&entry.key, item.entry_type); diff --git a/src/lib.rs b/src/lib.rs index 27cf999d..3814f991 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -548,12 +548,6 @@ entry! { "note" => note: FormatString, /// Abstract of the item (e.g. the abstract of a journal article). "abstract" => abstract_: FormatString, - /// Short markup, decoration, or annotation to the item (e.g., to indicate - /// items included in a review); - /// - /// For descriptive text (e.g., in an annotated bibliography), use `note` - /// instead. - "annote" => annote: FormatString, /// Type, class, or subtype of the item (e.g. “Doctoral dissertation” for /// a PhD thesis; “NIH Publication” for an NIH technical report); /// Do not use for topical descriptions or categories (e.g. “adventure” for an adventure movie). @@ -974,7 +968,7 @@ mod tests { "barb", ] ); - select_all!("*[abstract, annote, genre]", entries, ["wire"]); + select_all!("*[abstract, note, genre]", entries, ["wire"]); } #[test] diff --git a/tests/data/basic.yml b/tests/data/basic.yml index 3fabbf75..5e71dcb7 100644 --- a/tests/data/basic.yml +++ b/tests/data/basic.yml @@ -156,7 +156,7 @@ wire: started out as a police drama loosely based on the experiences of Simon's writing partner Ed Burns, a former homicide detective and public school teacher. - annote: The wire is noted to be solid + note: The Wire is noted to be solid genre: Drama affiliated: - role: executive-producer