Skip to content

Commit

Permalink
style: lint with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanChain committed Aug 25, 2024
1 parent f82b572 commit 29d6dec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ The main logic of merging items is described [above](#-how). A few points to emp
<details>
<summary>JavaScript API</summary>


```typescript
async Zotero.arXivWorkflow.merge(
preprintItem: Zotero.Item,
Expand All @@ -130,27 +129,28 @@ To use this feature, select (and only select) the PDF you want to open by defaul
Under the hood, this plugin does something "dirty".
</summary>


That is because Zotero does not have the functionality of setting the default PDF to open.
It determines the PDF to open by checking and sorting by:

- The attachment is a PDF
- The URL field of the PDF matches the URL of the parent item
- `dateAdded` of the PDF

Or in SQL:

```sql
ORDER BY contentType='application/pdf' DESC, url=? DESC, dateAdded ASC
```

Therefore, to make Zotero perfer a specific PDF, this plugin

1. sets URL field of the PDF attachment the same as that of parent item
2. sets the `dateAdded` field to be the oldest among all PDFs of parent item
</details>

<details>
<summary>JavaScript API</summary>


```typescript
async Zotero.arXivWorkflow.preferPDF(
selectedAttachment: Zotero.Item
Expand All @@ -164,9 +164,10 @@ This function assumes that the argument is a PDF attachment. Currently, no check
### 📄 Search for updated version of an arXiv paper

If you have a preprint item for the arXiv paper, and you want to find if it has been published on journals or updated on arXiv, and then update the information, you can right click on the preprint item and select "Update arXiv paper". This will search:

1. Published versions by trying:
1. [arXiv](https://arxiv.org) for the "Related DOI" field, which may be updated if the paper got published
2. [Semantic Scholar](https://www.semanticscholar.org) API
1. [arXiv](https://arxiv.org) for the "Related DOI" field, which may be updated if the paper got published
2. [Semantic Scholar](https://www.semanticscholar.org) API
2. If no published version found, the plugin will search [arXiv](https://arxiv.org) for updated versions

> [!Note]
Expand All @@ -179,7 +180,6 @@ After that, the preprint item and the newly created journal item will be merged
<details>
<summary>JavaScript API</summary>


```typescript
async Zotero.arXivWorkflow.arXivUpdate(
preprintItem: Zotero.Item
Expand All @@ -201,7 +201,6 @@ Say you have an arXiv paper PDF and import it into Zotero. Zotero finds that it
<details>
<summary>JavaScript API</summary>


```typescript
async Zotero.arXivWorkflow.updatePDF(
journalItem: Zotero.Item
Expand Down
2 changes: 1 addition & 1 deletion addon/chrome/content/preferences.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/>
</groupbox>
<groupbox>
<label><html:h2 data-l10n-id="pref-enable"></html:h2></label>
<label><html:h2 data-l10n-id="pref-enable"></html:h2></label>
<checkbox
id="zotero-prefpane-__addonRef__-enable-arXivMerge"
preference="extensions.zotero.__addonRef__.features.arXivMerge"
Expand Down

0 comments on commit 29d6dec

Please sign in to comment.