Skip to content

Commit

Permalink
Remove the annote field from the data model (typst#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
reknih authored and danilasar committed Dec 31, 2024
1 parent 9ceb581 commit e13112c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 25 deletions.
12 changes: 2 additions & 10 deletions docs/file-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,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 @@ -361,8 +353,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 @@ -233,7 +233,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 @@ -528,23 +528,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

0 comments on commit e13112c

Please sign in to comment.