Skip to content

Commit

Permalink
feat: Sync abstracts to Notion (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
theotheo committed Jan 22, 2022
1 parent 548b88b commit 7d2a55f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ the other properties must be configured exactly as specified here.
| Property Name | Property Type | Required |
| ------------------ | ------------- | -------- |
| `Name` | Title | Yes |
| `Abstract` | Text | No |
| `Authors` | Text | No |
| `DOI` | URL | No |
| `Editors` | Text | No |
Expand Down
4 changes: 4 additions & 0 deletions content/notero-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export default class NoteroItem {
this.zoteroItem = zoteroItem;
}

public getAbstract(): string | null {
return this.zoteroItem.getField('abstractNote') || null;
}

public getAuthors(): string[] {
const primaryCreatorTypeID = Zotero.CreatorTypes.getPrimaryIDForType(
this.zoteroItem.itemTypeID
Expand Down
5 changes: 5 additions & 0 deletions content/notion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ export default class Notion {
};

const propertyDefinitions: Definition[] = [
{
name: 'Abstract',
type: 'rich_text',
buildRequest: () => Notion.buildRichText(item.getAbstract()),
},
{
name: 'Authors',
type: 'rich_text',
Expand Down

0 comments on commit 7d2a55f

Please sign in to comment.