Anki Exporter is an Obsidian plugin for synchronizing Markdown flashcards with Anki through AnkiConnect.
Write flashcards directly inside your Obsidian notes:
What is an array? :: A contiguous collection of elements.
Then analyze and synchronize them with an Anki deck without maintaining the same content manually in both applications.
Question :: Answer syntaxFlashcards use the following format:
Question :: Answer
There must be exactly one space before and after ::.
Example:
# Data Structures
Array :: A contiguous collection of elements.
Stack :: A LIFO data structure.
Queue :: A FIFO data structure.
Normal Markdown content is ignored.
When a new flashcard is created in Anki, its Anki note ID is stored inside the Markdown document:
<!-- anki-note-id:123456789 -->
What is an array? :: A contiguous collection of elements.
During future synchronizations, the plugin uses this ID to determine whether the flashcard should be:
This allows the Obsidian note to remain the primary source of the flashcard content.
Before synchronizing, Anki Exporter can analyze all flashcards in the current note.
The preview groups flashcards into:
Updated flashcards include a before/after comparison so changes can be reviewed before they are applied.
The following applications are required:
Anki must be running while synchronizing flashcards.
By default, AnkiConnect is expected at:
http://127.0.0.1:8765
The URL can be changed in the plugin settings.
2055492159
Question :: Answer syntax.The project separates parsing, synchronization, Anki communication and UI logic.
Obsidian Markdown
│
▼
Flashcard Parser
│
▼
Sync / Analysis
│
▼
Anki Client
│
▼
AnkiConnect
│
▼
Anki
Project structure:
src/
├── anki/ # AnkiConnect integration
├── flashcards/ # Parsing and Markdown handling
├── sync/ # Synchronization and change analysis
├── ui/ # Obsidian user interface
├── main.ts # Plugin orchestration
└── settings.ts # Plugin settings
Install dependencies:
npm install
Start the development build:
npm run dev
Run the test suite:
npm test
Run tests with coverage:
npm run test:coverage
Run ESLint:
npm run lint
Create a production build:
npm run build
The project contains unit and integration tests covering areas such as:
GitHub Actions automatically runs:
Lint
↓
Automated Tests
↓
Coverage
↓
Production Build
Coverage reports are uploaded to Codecov.
Contributions, bug reports and feature suggestions are welcome.
Before opening a pull request, run:
npm run lint
npm test
npm run build
MIT