Skip to content

Commit

Permalink
Fail on unknown fields (fix #108); Fix doc comments; Fix documentatio…
Browse files Browse the repository at this point in the history
…n for DOI (fix #110)
  • Loading branch information
DerDrodt committed Dec 15, 2023
1 parent d2db1fa commit 6116700
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 1 addition & 9 deletions docs/file-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,20 +298,12 @@ This section lists all possible fields and data types for them.
| **Description:** | canonical public URL of the item, can have access date |
| **Example:** | `url: { value: https://www.reddit.com/r/AccidentalRenaissance/comments/er1uxd/japanese_opposition_members_trying_to_block_the/, date: 2020-12-29 }` |

#### `doi`

| | |
|------------------|-----------------------------------------------------------|
| **Data type:** | string |
| **Description:** | Digital Object Identifier (DOI) of the item (without resolver). Due to YAML's way of parsing strings, some DOIs have to be wrapped by double-quotes as shown below. |
| **Example:** | `doi: "10.22541/au.148771883.35456290"` |
#### `serial-number`

| | |
|------------------|-----------------------------------------------------------|
| **Data type:** | string or dictionary of strings |
| **Description:** | Any serial number, including article numbers. If you have serial numbers of well-known schemes like `doi`, you can put them into the serial number as a dictionary like in the second example. Hayagriva will recognize and specially treat `doi`, `isbn` `issn`, `pmid`, `pmcid`, and `arxiv`. You can also include `serial` for the serial number when you provide other formats as well. |
| **Description:** | Any serial number, including article numbers. If you have serial numbers of well-known schemes like `doi`, you should put them into the serial number as a dictionary like in the second example. Hayagriva will recognize and specially treat `doi`, `isbn` `issn`, `pmid`, `pmcid`, and `arxiv`. You can also include `serial` for the serial number when you provide other formats as well. |
| **Example:** | `serial-number: 2003.13722` or <pre>serial-number:<br> doi: "10.22541/au.148771883.35456290"<br> arxiv: "1906.00356"<br> serial: "8516"</pre> |

#### `language`
Expand Down
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ quantized-vortex:
title: Structure of a Quantized Vortex in Boson Systems
date: 1961-05
page-range: 454-477
doi: 10.1007/BF02731494
serial-number:
doi: 10.1007/BF02731494
parent:
issue: 3
volume: 20
Expand Down Expand Up @@ -354,6 +355,7 @@ macro_rules! entry {
struct MyVisitor;

#[derive(Deserialize)]
#[serde(deny_unknown_fields)]
struct NakedEntry {
#[serde(rename = "type")]
entry_type: Option<EntryType>,
Expand Down

0 comments on commit 6116700

Please sign in to comment.