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

feat: Add experimental support for syncing notes #290

Merged
merged 57 commits into from
Jul 27, 2023

Conversation

dvanoni
Copy link
Owner

@dvanoni dvanoni commented Jul 10, 2023

This PR adds initial support for syncing Zotero notes into Notion as requested in #4. The primary focus is on ensuring note content is reflected in Notion as accurately as possible.

This first release requires users to opt in to this new functionality by enabling it within Notero Preferences, and it does not sync notes automatically.

Usage

  1. To enable support for syncing notes, enable the Sync notes (EXPERIMENTAL) checkbox at the bottom of Notero preferences.
  2. Select a note under a synced item, right-click it to open the context menu, and select Sync to Notion.
  3. The syncing progress window should display at the bottom-right of Zotero, and the note should be saved as content within the body of the Notion page.
    • All notes for an item are saved under a toggle heading named Zotero Notes.
    • Each note is saved under a toggle heading with the name of the note.
  4. If note content is updated in Zotero, it must be manually synced again using the above steps.
CleanShot.2023-07-26.at.20.34.48-converted.mp4

PDF Annotations

To sync annotations (notes and highlights) from a PDF into Notion, you'll first need to extract them into a Zotero note.

  1. Select an item or PDF, right-click it to open the context menu, and select Add Note from Annotations.
  2. If desired, enable highlight colors from the menu at the top-right of the note panel.
  3. Sync the generated note using the above steps.
CleanShot.2023-07-26.at.20.41.32-converted.mp4

Development Notes

This has been a long-running branch that now includes many updates from the past few months. Some updates of note include:

  • Use named exports instead of default exports
  • Change Jest test environment to jsdom
  • Mock Zotero and XPCOM globally for tests
  • Rename typings directory to types
  • Install @total-typescript/ts-reset package
  • Add dev script to start dev build
  • Change ESLint config from JSON to JS to use tsconfigRootDir option

dvanoni added 30 commits July 1, 2023 18:07
@dvanoni dvanoni linked an issue Jul 10, 2023 that may be closed by this pull request
@github-actions
Copy link
Contributor

🤖 Build Bot

✅ Successful build

⬇️ Download: notero-0.4.8-123

@socket-security
Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
jest-environment-jsdom 29.5.0 network, shell +44 6.9 MB simenb
@total-typescript/ts-reset 0.4.2 None +0 19.2 kB mpocock

@dvanoni dvanoni marked this pull request as ready for review July 27, 2023 03:59
@dvanoni dvanoni merged commit bb69ecb into main Jul 27, 2023
4 checks passed
@dvanoni dvanoni deleted the 4-sync-notes-and-annotations branch July 27, 2023 06:08
@sheldon123z
Copy link

image

@dvanoni
Copy link
Owner Author

dvanoni commented Aug 24, 2023

Thanks for posting that screenshot, @sheldon123z. I didn't mention it anywhere, but what you're encountering is another known limitation of the current approach. There's a limit to how much content can be sent in a single Notion API request, so to deal with this I need to come up with a solution for breaking larger requests into multiple requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants