Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the annote field from the data model #220

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions docs/file-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

| | |
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/csl/taxonomy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions src/interop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,23 +520,23 @@ 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);
}
}

if let Some(abstract_) = map_res(entry.abstract_())? {
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);
Expand Down
8 changes: 1 addition & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -974,7 +968,7 @@ mod tests {
"barb",
]
);
select_all!("*[abstract, annote, genre]", entries, ["wire"]);
select_all!("*[abstract, note, genre]", entries, ["wire"]);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion tests/data/basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down