Repository navigation
feat: implement audio card type (rename from cloze deletion) - #27
Open
ethanelasky wants to merge 7 commits into
Open
ethanelasky wants to merge 7 commits into
ethanelasky wants to merge 7 commits into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IsAudioCard(wasSeparateClozeDeletionCard)IsAudioCardandIsSentenceCardshows 「?」 instead of the sentence, testing comprehension from audio aloneAltDisplaydetection for the audio card type (was previously hardcoded tofalse)RenameFieldaction) for upgrading from 0.11.xThis 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 (
IsAudioCardfilled):[...], audio auto-playsSentence audio card (
IsAudioCard+IsSentenceCardfilled):Test plan
python tools/make.py --releaseand verify no errors[...]for bolded wordsIsSentenceCardis also filledpython tools/install.pyon existing note to verify field rename migration🤖 Generated with Claude Code