View on GitHub Install from Obsidian
Panda Zap is an Obsidian desktop plugin that turns Q/A pairs in your Markdown notes into Anki flashcards. It reads notes from your vault, sends them to Anki through the AnkiConnect add-on, and keeps each note's cards in step as you edit.
Cards live in your notes. You write questions and answers with Q: and A: markers, choose a deck by note path or with a one-line override, and sync from the command palette, the ribbon, or the file menu. When you use the sync dialog, it shows exactly what will be added, updated or removed before anything changes, and nothing is deleted without confirmation.
Features
- Q/A extraction. Write cards with
Q:andA:markers anywhere in a note. Multi-line answers, lists, tables and paragraphs are supported. - Images. Attach one image per card with
I:, from a vault file or anhttp(s)URL. - Deck targeting. Frontmatter
deck:, a first-line override, note-based decks derived from the note path, or the configured default deck. - Sync dialog. A summary and preview of every add, update and deletion, per-card progress, and a cancel button.
- One-step sync. Sync the current note, selected notes, or all notes from the command palette or the file menu, without opening the dialog.
- Sync on save. Optionally sync notes that already have Anki cards a moment after you save them.
- Anki edit protection. Cards you edit directly in Anki are detected and skipped instead of overwritten.
- Rename safe. Renaming or moving a note migrates its cards to the new name and deck instead of orphaning them.
- Media cleanup. Remove uploaded images that no Anki note references any more.
Quick start
Install Panda Zap from the Obsidian community plugins store or sideload the latest release from GitHub. Install the AnkiConnect add-on in Anki and keep Anki running.
Create a note with a few cards:
Q: What is the capital of France? A: Paris Q: What year did World War II end? A: 1945 Q: What does HTTP stand for? A: Hypertext Transfer ProtocolOpen the note and click the zap icon in the left ribbon. The sync dialog opens, checks the connection, and shows three cards to add. Click Sync to Anki.
The cards are added to the deck the note resolves to. By default that is a deck built from the note's folder and name, for example a note at
Languages/French.mdgoes toLanguages::French. See Deck targeting to change it.
How it works
Panda Zap runs four steps: extract, analyse, review, write.
1. Extract. Panda Zap reads the note (the editor buffer when the note is open, so unsaved edits count) and pulls out every Q/A card. Code blocks, frontmatter and HTML comments are ignored. Each card holds a question, an answer and at most one image.
2. Analyse. It connects to Anki, works out the note's target deck, and matches the extracted cards to the Anki notes that belong to this note. Each card is classified as an addition, an update, a removal, already up to date, or changed in Anki.
3. Review. The sync dialog shows the counts and can list every card with its target deck. Deletions always get their own confirmation before anything is removed.
4. Write. On confirmation, Panda Zap adds and updates cards one at a time, uploads images, and applies the plugin tags. Removed cards are deleted last. The sync is one-way: notes are the source, and Anki is never written back into your vault.
Writing cards
Panda Zap finds cards by the marker words at the start of a line. The defaults are Q: for a question, A: for an answer and I: for an image. All three can be changed in settings. Matching is case-insensitive, so q: and Q: behave the same.
A card starts at a Q: line. The answer can be on the same line or on the lines below.
Single-line cards
Q: What is the SI unit of force? A: Newton
Q: Who wrote Macbeth? A: William Shakespeare
Q: What does CPU stand for? A: Central Processing Unit
A card can also carry an image instead of answer text:
Q: What does the sync dialog look like? I: [[sync-dialog.png]]
Multi-line answers
When an answer needs more room, put the question on one line and the answer on the lines directly below it. The answer runs until the next Q: line or the first blank line, whichever comes first.
An A: line is optional here. Use it when you want the answer to start on its own line.
Bullet list:
Q: What are the three states of matter?
- Solid
- Liquid
- Gas
Numbered steps:
Q: Steps to boil an egg
1. Fill a pot with water
2. Bring it to a boil
3. Add the egg
4. Wait 7 minutes
Table:
Q: What do these HTML tags do?
| Tag | Purpose |
| ------- | --------- |
| `<p>` | Paragraph |
| `<a>` | Link |
| `<img>` | Image |
Paragraphs:
Q: What is photosynthesis?
Photosynthesis is how plants turn sunlight into energy.
It happens in the chloroplasts using a pigment called chlorophyll.
Keep the answer lines directly under the question. A blank line ends the card, so an answer separated from its question by a blank line produces no card.
Images
The I: marker adds one image to the back of the card, after the answer text. A: is optional when the card has an image.
Panda Zap accepts the usual Obsidian image syntaxes and plain paths:
Q: Identify this organelle
A: Mitochondrion
I: [[mitochondrion.jpg]]
Q: What does the toolbar look like?
I: ![[toolbar-screenshot.png]]
Q: Where is the login button?
A: Top right
I: 
Q: Where is the login button?
A: Top right
I: assets/login.png
Remote images work too:
Q: What does this chart show?
A: Revenue by quarter
I: https://example.com/chart.png
- Local images are resolved like Obsidian links, so a bare filename, a path relative to the note, or a path relative to the vault all work.
- Remote images must be
httporhttpsURLs. They are downloaded when the card is synced. - Local and remote images are limited to 10 MB, and a remote download times out after 30 seconds.
- Panda Zap does not check the file extension. The file is uploaded to Anki and shown with an
<img>tag, so use a format Anki can display, such as PNG or JPEG. - One image per card. If a card has more than one
I:line, only one image is attached. - If an image cannot be found, read or downloaded, that card is not synced. The result list shows
Image failedwith the reason, and the rest of the note still syncs.
Deck targeting
Panda Zap resolves the target deck in this order, and the first match wins:
| Priority | Method | Example |
|---|---|---|
| 1 | Frontmatter | deck: Biology/Plants in the note's YAML frontmatter |
| 2 | First line | Deck::Biology/Plants on the first line after the frontmatter |
| 3 | Note-based | Biology/Plants/Photosynthesis.md becomes Biology/Plants::Photosynthesis |
| 4 | Default deck | The Default deck setting, Default unless you change it |
Frontmatter. Put a top-level deck: key in the frontmatter block at the top of the note:
---
deck: Spanish/Vocab
---
Q: Hello A: Hola
Q: Goodbye A: Adios
Single and double quotes are allowed: deck: "Spanish/Vocab".
First-line override. Without a frontmatter deck: key, the first line after the frontmatter can name the deck:
Deck::Spanish/Vocab
Q: Hello A: Hola
Q: Goodbye A: Adios
If both forms are present, the frontmatter wins. A deck: key lower in the note body is ordinary text and is never used as an override.
The Deck override word setting changes the word before :: (default Deck). The frontmatter key is always deck:.
Use slashes or :: for nested decks. Panda Zap converts slashes to ::, so Deck::Biology/Cell-Biology and deck: Biology::Cell-Biology both target Biology::Cell-Biology.
Note-based decks. With Use note-based deck organization on (the default), a note without an override goes to a deck named from its path: the folders as written, then ::, then the file name. A note at Biology/Plants/Photosynthesis.md becomes Biology/Plants::Photosynthesis. Panda Zap creates the deck when it does not exist yet.
Default deck. With note-based decks off, every card without an override goes to the Default deck setting. That deck must already exist in Anki.
Several notes can target the same deck. Their cards merge in Anki, but each note's cards stay tracked separately, so deleting cards from one note never touches another note's cards in the same deck.
Formatting rules
- Labels are case-insensitive.
Q:,q:,A:,a:all work, and a card can mix cases. - Bold and italic around labels are stripped.
**Q:**,*A:*and_I:_are recognised, and the label is removed from the card text. - Markdown inside answers is kept. Bold, italic, inline code, links, lists and tables are sent to Anki as written.
- Whitespace is trimmed. Extra spaces around questions and answers are removed, and blank lines between cards are ignored.
- A question with no text produces no card. A card with neither an answer nor an image is not extracted.
What extraction ignores
Panda Zap does not scan everything. Cards inside these are skipped, so you can keep examples in a note:
- Fenced code blocks, using triple backticks or tildes.
- Indented code blocks (four or more spaces after a blank line).
- YAML frontmatter at the top of the note.
- HTML comments, from
<!--to-->.
Two edge cases are worth knowing. An HTML comment that is never closed with --> hides the rest of the note, and a fenced code block indented four or more spaces inside a list item is still scanned.
Syncing to Anki
The sync dialog
Open the dialog with the zap ribbon icon or the Panda Zap: Open sync dialog command. It checks the AnkiConnect connection, analyses the active note, and shows a summary of cards to add, cards to update, cards changed in Anki and cards to remove.
- Preview changes opens a read-only list grouped into Cards to Add, Cards to Update, Cards Changed in Anki (skipped) and Cards to Remove. Each card shows its question, answer, image path and target deck. In a batch sync it also shows the source note.
- Sync to Anki starts the run. Cards are processed one at a time with a Processed N / M cards counter and a Cancel button. Cancel stops before the next Anki write and the completion notice reports what was finished.
- Test connection appears when the dialog cannot reach Anki. The status line shows the reason, such as AnkiConnect being unreachable or out of date.
- The gear button opens the plugin settings. You cannot close the dialog while a sync is running; cancel it first.
- Deleting cards always opens a confirmation listing the number of cards and, when relevant, how many of them were changed in Anki. The sync only deletes after you confirm.
- When the run ends, the dialog lists each card as added, updated, failed, image failed or skipped. Skipped cards are folded into a Skipped section.
Only one dialog can be open at a time. Running a sync command while it is open shows a notice instead of starting a second run.
One-step sync
These actions start a sync. Deletions are confirmed in every path, and the direct syncs skip the dialog without skipping that confirmation.
| Action | Where | What happens |
|---|---|---|
| Open sync dialog | Command palette | Opens the dialog for the active note. |
| Sync current note to Anki | Command palette | Syncs the active note directly, using the editor contents so unsaved edits are included. Only available while a Markdown note is open. |
| Sync selected notes to Anki | Command palette | Opens the dialog for the notes selected in the file explorer. |
| Sync all notes to Anki | Command palette | Opens the dialog for every Markdown note that contains cards. |
| Sync note to Anki, or Sync N notes to Anki for a multi-selection | Right-click a Markdown file | Syncs the file, or all selected files, directly. One confirmation covers every deletion in the batch. |
| Clean up orphaned media | Command palette | Removes uploaded images that no Anki note references. See Orphaned media. |
Sync on save
Sync on save is off by default. When you enable it, Panda Zap syncs a note about 2.5 seconds after it is saved, and rapid saves are merged into a single run.
- Only notes that already have cards in Anki are touched. A note that has never been synced is never added silently.
- Silent syncs never delete. Cards you remove from a note stay in Anki until you run a manual sync.
- Cards changed in Anki are always skipped, even when Overwrite changes made in Anki is on.
- There is no dialog. The status bar shows what is happening: syncing, how many cards were left alone, idle, or a failure. Hover the status item for the detail, and check the Anki connection after an error.
- Sync on save pauses while the sync dialog is open or media cleanup is running.
- A failure clears on the next successful sync. Run a manual sync when you need the full result list.
Anki edit protection
Every synced Anki note carries a pandazap-sync: tag containing a fingerprint of the Front and Back fields Panda Zap last sent. If the fields no longer match that fingerprint, the note was changed directly in Anki.
By default Panda Zap protects that edit:
- The card is skipped and reported as changed in Anki in the sync dialog and the completion notice.
- The note's other cards still sync normally.
- The Anki note keeps its fields and tags unchanged.
To let your Obsidian note win instead, enable Overwrite changes made in Anki in settings. The next manual sync replaces the Anki fields with the note's text. Sync on save still skips these cards, so a silent sync never discards an edit you did not ask it to overwrite.
Notes synced by an older version of Panda Zap have no fingerprint yet. They sync once normally and receive one, so detection starts from that sync onward.
Deletions are covered too. If a card you removed from the note was also edited in Anki, the deletion confirmation says how many cards in the delete set were changed in Anki before you confirm.
Panda Zap adds four tags to Anki notes:
panda-zapmarks notes created by the plugin.obsidianis added alongside it.- A
source:tag identifies the note a card came from. This is how a sync updates and deletes only that note's cards, even when several notes share a deck. - The
pandazap-sync:fingerprint is used for the edit detection described above.
You do not need to manage these tags. Leave them in place, otherwise Panda Zap may stop recognising a note's cards.
Renaming and moving notes
Renaming or moving a note keeps its cards. Panda Zap migrates them to the new path: they are retagged for the new name and moved to the deck the new path or override targets. Migration runs when you rename, when the plugin loads, and before a sync, so a rename made while Anki was unreachable is retried.
- A note whose migration still fails is not synced. A notice names the note; connect to Anki and sync again.
- Cards that cannot be matched to the renamed note with certainty, usually from older plugin versions, are left in Anki with a warning that they may remain as orphans.
- Cards you moved to another deck by hand stay where you put them.
Orphaned media
Every image Panda Zap uploads is stored in Anki's media folder with a pandazap_ prefix. When you delete cards or remove images from notes, the uploaded files can be left behind.
Run Panda Zap: Clean up orphaned media from the command palette. It:
- Lists the
pandazap_*files that no Anki note references. - Shows the first few names and asks for confirmation before deleting anything.
- Checks references again after you confirm, so a file that has just been used is kept.
If nothing is orphaned, it tells you and stops. Cleanup cannot run while a sync is running or the sync dialog is open, and Panda Zap blocks new syncs while cleanup runs.
Settings
| Setting | What it does |
|---|---|
| Use note-based deck organization | On by default. Creates a deck from the note path, for example Biology/Plants::Photosynthesis. Turn it off to send every card without an override to the default deck. |
| Default deck | The deck for cards with no note-based deck and no override. Picked from a list read from Anki. Defaults to Default, and must exist in Anki. |
| Note type | The Anki note type used for new notes, picked from a list read from Anki. Defaults to Basic. It must have fields named Front and Back; Cloze and other types without them do not work. |
| Sync on save | Off by default. Syncs a saved note after a short delay, only if it already has Anki cards. See Sync on save. |
| Overwrite changes made in Anki | Off by default. Overwrites cards you edited in Anki instead of skipping them. Sync on save always skips them. |
| Bold question in reading mode | On by default. Bolds the question text in Obsidian's reading view. Presentation only; it does not change what is sent to Anki. |
| Anki connect URL | Where AnkiConnect listens. Defaults to http://127.0.0.1. A bare host such as localhost:8765 is treated as http://localhost:8765, and a path in the URL is kept. |
| Anki connect port | Defaults to 8765. Must be a whole number from 1 to 65535. The port is only applied when the URL has no port of its own. |
| Deck override word | The word before :: in the first-line deck override. Defaults to Deck. Cannot be empty or contain a line break. |
| Question word, Answer word, Image word | The marker words, defaulting to Q, A and I. They cannot be empty or contain : or a line break. Using the same word for two markers is allowed but warns, because cards may parse unreliably. |
| Test Anki connection | The Test connection button reports Connected with the AnkiConnect version and endpoint, or the reason it failed. |
| Restore defaults | Resets the settings to their defaults. Renames still waiting to reach Anki are kept. |
The deck and note type lists have a Refresh button. Names are read from Anki when the settings tab opens, and the saved value stays selected and usable while Anki is unreachable. The same connection test is available from the sync dialog.
Panda Zap validates settings as you type. An invalid AnkiConnect URL or port keeps the last valid value and shows a message, and an invalid deck name or marker word is not saved.
Requirements
- Obsidian 1.13.0 or newer, desktop only. The plugin manifest requires 1.13.0 and declares itself desktop only.
- Anki desktop, running while you sync.
- AnkiConnect add-on, installed from Anki's add-on manager with code
2055492159. Panda Zap requires AnkiConnect 6 or newer.
AnkiConnect must be reachable. The default endpoint is http://127.0.0.1:8765. If you changed the port or run AnkiConnect on another host, update the URL and port in the plugin settings.
Troubleshooting
| Problem | What to check |
|---|---|
| Not connected to Anki | Make sure Anki is running, the AnkiConnect add-on is installed and enabled, and the URL and port match. Use Test connection in the dialog or the settings tab. |
| AnkiConnect is out of date | Update the AnkiConnect add-on. Panda Zap requires version 6 or newer. |
| A card is skipped as changed in Anki | The card was edited in Anki after the last sync. Edit the note to match, enable Overwrite changes made in Anki, or revert the Anki edit. |
| No cards found in a note | Check the Q: and A: markers, and make sure the card is not inside a code block, frontmatter or HTML comment. A question needs text and an answer or an image. |
| Image failed | Check the path or URL. Remote images must be http or https and both local and remote images are limited to 10 MB. |
| Cards land in an unexpected deck | Check the frontmatter deck: key first, then the first line of the note, then the note-based deck setting and the default deck. |
| A renamed note does not sync | Its card migration has not reached Anki yet. Connect to Anki and sync again; the notice names the note. |
| Cards removed from a note stay in Anki | Sync on save never deletes. Run a manual sync and confirm the deletion. |
| A sync command says a dialog is already open | Close the open sync dialog, or cancel the run inside it, before starting another sync. |
What's not supported
These are outside Panda Zap's design:
- Cloze deletions. The plugin writes
FrontandBackfields only. Use a note type with those fields, usually Basic. - Custom field mappings. There is no way to map a card to other fields.
- Multiple note types per note. One note type is used for all new cards.
- Reverse cards. Each Q/A pair produces one card: question on the front, answer on the back.
- Audio and video. Files referenced with
I:are embedded with an<img>tag. Only images display. - Multiple images per card. One
imageper card. - Excluding individual cards. The sync dialog has no per-card checkboxes. A sync applies the whole analysis; the only choice is whether to confirm the deletion prompt, and declining it cancels the sync.
- Two-way sync. Sync is one-way. Changes made in Anki are never written back to your notes, though Panda Zap does detect them and skip those cards by default.
Team Super Panda

