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

Add abstract field #35

Merged
merged 2 commits into from
Jan 22, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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