|
| 1 | +It's an addon that loads toggle lists from <a href="https://notion.so" rel="nofollow">Notion</a> as notes to a specified deck. |
| 2 | + |
| 3 | +<img src="https://raw.githubusercontent.com/9dogs/notion-anki-sync/main/tldr.png"> |
| 4 | + |
| 5 | +- You provide a set of Notion page ids to export</li> |
| 6 | +- Every "toggle list" block from Notion will be converted to an Anki note</li> |
| 7 | +- Title of the toggle block will become the front side and its content — the backside</li> |
| 8 | +- The line starting with <code>#tags</code> will be parsed as tags</li> |
| 9 | +- Ignore toggles by putting symbol ❕ in front of a toggle title (type ":!" in Notion and select the white one) |
| 10 | + |
| 11 | +Clozes can be added via <code>code</code> blocks in toggle titles. Backside will be ignored (apart from tags). |
| 12 | +Synchronization can work in the background or can be triggered manually from the <code>Notion</code> submenu in the <code>Tools</code> section. Note that background sync <strong>does not remove</strong> any notes; if you want to remove the obsolete notes, then trigger <code>Load and remove obsolete</code> from the submenu. |
| 13 | + |
| 14 | +<b>Requirements</b> |
| 15 | +<b>1. Notion API token</b> |
| 16 | +To get <strong>Notion API token</strong> log in to Notion via a browser (assuming Chrome here), then press <code>Ctrl+Shift+I</code> to open Developer Tools, go to the "Application" tab and find <code>token_v2</code> under Cookie on the left. |
| 17 | + |
| 18 | +<b>2. Notion page ids</b> |
| 19 | +To get <strong>Notion page id</strong> open up the page in a browser and look at the address bar. 32 chars of gibberish after a page title is the page id: <code><a href="https://www.notion.so/notion_user/My-Learning-Book-8a775ee482ab43732abc9319add819c5" rel="nofollow">https://www.notion.so/notion_user/My-Learning-Book-8a775ee482ab43732abc9319add819c5</a></code> |
| 20 | +➡ <code>8a775ee482ab43732abc9319add819c5</code> |
| 21 | + |
| 22 | +Edit plugin config file from Anki <code>Tools ➡ Add-ons ➡ NotionAnki ➡ Config</code> and paste Notion token in <code>notion_token</code> config parameter, your Notion username as <code>notion_namespace</code> and fill in `notion_pages` section. |
| 23 | + |
| 24 | +<b>Known issues & limitations</b> |
| 25 | +Behind the scenes, the addon initiates Notion pages export to HTML, then parses the HTML into notes. Since non-public Notion API is used, the addon may break without a warning. |
| 26 | + |
| 27 | +1. As for now, LaTeX and plain text cannot be used in the same cloze: Notion puts them in separate <code>code</code> tags which |
| 28 | +leads to the creation of two cloze blocks. |
| 29 | +2. Some toggle blocks are empty on export which leads to empty Anki notes. The issue is on the Notion side (and they're |
| 30 | +aware of it). |
| 31 | + |
| 32 | +<b>Configuration parameters</b> |
| 33 | +- <code>debug</code>: <code>bool [default: false]</code> — enable debug logging to file. |
| 34 | +- <code>sync_every_minutes</code>: <code>int [default: 30]</code> — auto sync interval in minutes. Set to 0 to disable auto sync. |
| 35 | +- <code>anki_target_deck</code>: <code>str [default: "Notion Sync"]</code> — the deck loaded notes will be added to. |
| 36 | +- <code>notion_token</code>: <code>str [default: None]</code> — Notion APIv2 token. |
| 37 | +- <code>notion_namespace</code>: <code>str [default: None]</code> — Notion namespace (your username) to form source URLs. |
| 38 | +- <code>notion_pages</code>: <code>array [default: [] ]</code> — List of Notion pages to export notes from. |
| 39 | + |
| 40 | +<b>Inspiration</b> |
| 41 | +This project is inspired by a great <a href="https://github.com/alemayhu/notion2anki" rel="nofollow">notion2anki</a>. |
0 commit comments