liufree18 downloadsAI-powered cloze reading view: open any note to generate a cloze reading view, adjust cloze density, remember the last AI cloze result (unless you regenerate), and spaced-repetition review mode (integrated with the Obsidian API). Supports custom AI providers and models.
AI-powered cloze reading view + spaced-repetition review mode. Stack: Obsidian Plugin API + React 18 + Ant Design 5 + esbuild + TypeScript.
data.json) directly for the last result; the AI is only re-invoked when you click "Re-cloze with AI"; a yellow hint appears when "original note modified". Enable "auto cloze" in settings to invoke the AI automatically when opening an uncached note (long notes consume a lot of tokens; a hint is shown when this triggers).data.json). On completion, Good/Easy terms can be written back to the note as under a "🎴 cloze flashcards" section (#flashcards review/flashcard, compatible with the Spaced Repetition plugin).A demo note is included at demo/demo-note.md. Open it in Obsidian and run "Open AI cloze reading view for current note" to try AI cloze generation, density adjustment, review cards, and flashcard export.
npm install
npm run dev # watch build
npm run build # typecheck + production build + deploy to .obsidian/plugins/ai-cloze
npm run smoke # pure logic + jsdom DOM + React component smoke tests
Build output auto-deploys to .obsidian/plugins/ai-cloze/; restart Obsidian or reload the plugin in settings to take effect.
| File | Description |
|---|---|
src/main.tsx |
Plugin entry: registers view, commands, settings tab |
src/view.tsx |
Custom ItemView (React mount) |
src/components/App.tsx |
Main UI: toolbar + reading/review switch + cache & generation logic |
src/components/ReadingMode.tsx |
Reading cloze rendering |
src/components/ReviewMode.tsx |
Review mode |
src/ai.ts |
AI provider client (OpenAI-compatible / Anthropic / Ollama) |
src/cloze.ts |
AI prompt, JSON parsing, density selection |
src/dom.ts |
Markdown DOM cloze wrapping |
src/srs.ts |
SM-2 spaced repetition |
src/settings.ts |
Settings tab |
MIT