Skip to content

feat: implement audio card type (rename from cloze deletion) - #27

Open
ethanelasky wants to merge 7 commits into
arbyste:masterfrom
ethanelasky:feature/audio-card
Open

ethanelasky wants to merge 7 commits into
arbyste:masterfrom
ethanelasky:feature/audio-card

Conversation

@ethanelasky

Copy link
Copy Markdown

Summary

  • Renames "Cloze Deletion Card" to "Audio Card" with field IsAudioCard (was SeparateClozeDeletionCard)
  • Adds auto-play of sentence audio on the front side of the card
  • Adds sentence audio variant: filling both IsAudioCard and IsSentenceCard shows 「?」 instead of the sentence, testing comprehension from audio alone
  • Fixes AltDisplay detection for the audio card type (was previously hardcoded to false)
  • Includes migration path (RenameField action) for upgrading from 0.11.x

This implements the audio card feature as described in the prerelease documentation, which was planned for v0.12.0.0 but never merged.

How it works

Regular audio card (IsAudioCard filled):

  • Front: sentence displayed with bolded word(s) replaced by [...], audio auto-plays
  • Back: front display repeated at top, full sentence with word revealed below

Sentence audio card (IsAudioCard + IsSentenceCard filled):

  • Front: displays 「?」 with audio auto-play, testing entire sentence comprehension
  • Back: question repeated at top, full sentence revealed below

Test plan

  • Build with python tools/make.py --release and verify no errors
  • Install in Anki and verify the audio card shows [...] for bolded words
  • Verify audio auto-plays on the front
  • Test sentence variant shows 「?」 when IsSentenceCard is also filled
  • Test upgrade path: run python tools/install.py on existing note to verify field rename migration

🤖 Generated with Claude Code

ethanelasky and others added 7 commits May 6, 2026 03:53
Renames 'Cloze Deletion Card' to 'Audio Card' with field
`IsAudioCard` (was `SeparateClozeDeletionCard`). Adds:
- Auto-play sentence audio on the front side
- Sentence audio variant (IsAudioCard + IsSentenceCard) showing 「?」
- Proper AltDisplay detection for the audio card type
- Migration path from 0.11.x field name

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a field_exclude mechanism to base.html so templates can specify
fields that, when filled, prevent the card from generating. The Mining
Card now excludes IsAudioCard, so only the Audio Card is generated
when IsAudioCard is filled — no more duplicate cards.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The blank-front approach doesn't work cleanly with Anki — it still
generates the card and shows an error. Instead, both cards generate
normally and users set a deck override on the Audio Card template
to route audio cards to a separate subdeck.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The cloze deletion card previously collapsed the primary definition
since it was considered unimportant. For audio cards, users need to
see the definition to verify comprehension.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instead of a separate Audio Card template (which always generated
a duplicate card), the Mining Card now handles audio behavior
directly when IsAudioCard is filled. One note → one card.

- Mining Card shows [...] cloze display when IsAudioCard filled
- Auto-plays sentence audio on front
- Shows "Audio" / "Audio (Sentence)" card type label
- Sentence variant (IsAudioCard + IsSentenceCard) shows 「?」
- Removed the separate cloze_deletion template from generating

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
User wants both vocab and audio cards from the same note.
Mining Card is back to normal word display, Audio Card template
re-enabled with IsAudioCard + SentenceAudio field restriction.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant