Date: 2 May 2026
Status: ✅ Verified and Working
data/course/{course}/{unit}/{module}/{lesson}/anki/*.jsondata/course/psychology-l2/01/01m/001/anki/01-counselling-skills.jsonJSON File → apkg_generator.py → .apkg Package → Anki Desktop
Key Scripts:
apkg_generator.py - Main generator (reads JSON, creates APKG)generate_unit_apkg.py - Creates unit-level APKG filesrebuild_all_apkgs.py - Rebuilds all APKG filesNOT Used in Production:
content_parser.py - Was created for markdown parsing (deprecated)json_generator.py - Was created to use content_parser (deprecated)How it Works:
"course": "Psychology"metadata.get("course")scripts/anki/styles/{course}.cssExample:
1# In apkg_generator.py
2course = metadata.get("course", None) # "Psychology"
3basic_model = self._create_basic_model(course) # Loads psychology.css
Available Compiled CSS:
scripts/anki/styles/psychology.css (16 KB)scripts/anki/styles/devops.css (17 KB)Compilation:
1npm run anki:styles:compile # Compiles all SCSS → CSS
2npm run anki:styles:watch # Watch mode for development
html_enabled flag in JSON is stored but NOT checked by the generator"html_enabled": true in JSON metadata for documentation purposes1{
2 "id": "u1m1l01-006",
3 "question": "<b>Define:</b> What is <em>active listening</em>?",
4 "answer": "<p><strong>Active listening</strong> is a technique where:</p><ul><li>Fully concentrates</li><li>Demonstrates engagement</li><li>Responds appropriately</li></ul>",
5 "html_enabled": true,
6 "difficulty": 1
7}
scripts/anki/styles/
├── _variables.scss # Global design tokens (colors, spacing)
├── _base-components.scss # Universal components (all courses)
├── courses/
│ ├── psychology.scss # Psychology-specific overrides
│ ├── devops.scss # DevOps-specific overrides
│ └── {new-course}.scss # Add new courses here
├── psychology.css # Compiled output (16 KB)
└── devops.css # Compiled output (17 KB)
From _base-components.scss:
.skill-card - List of skills with left border.comparison-box - Side-by-side comparisons.definition-card - Highlighted definitions.emphasis-text - Emphasized text.code-block - Code formatting.success-box, .warning-box, .info-boxCourse-specific overrides in courses/*.scss
Styling Scripts:
1npm run anki:styles:compile # Compile all SCSS to CSS
2npm run anki:styles:compile:psychology # Compile psychology only
3npm run anki:styles:compile:devops # Compile devops only
4npm run anki:styles:watch # Watch mode for development
5npm run anki:styles:list # List compiled CSS files
Generation Scripts:
1npm run anki:rebuild # Rebuild all APKG files
2npm run anki:rebuild:verbose # Verbose output
3npm run anki:rebuild:unit # Rebuild specific unit
Testing Scripts:
1npm run test:anki:verbose # Run tests with verbose output
2npm run test:anki:coverage # Run with coverage report
<!-- ANKI:card:cs-001 --> system (not needed).prompts/anki/ - Contains ORIGINAL correct documentation (JSON-based)content/docs/anki/ - Contains REWRITTEN documentation (marker-based, incorrect)draft: true✅ JSON files are manually created - No markdown parsing
✅ CSS is automatically injected - Based on course name in metadata
✅ HTML is always supported - Use freely in all cards
✅ SCSS system is production-ready - Just compile and use
✅ Package scripts all work - No changes needed
❌ Marker system is not needed - content_parser.py not used
❌ Current docs are incorrect - Need to restore original workflow docs