1
0
Files
medical-notes/.github/copilot-instructions.md
Johan Dahlin 50366b9b9c
All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 2m29s
vault backup: 2025-12-26 02:09:22
2025-12-26 02:09:22 +01:00

6.3 KiB
Raw Permalink Blame History

Architecture

Quartz Site Workflow

  • Use Node 22+ and npm 10.9+ as enforced in package.json; run npm install once, then npm run docs to build+serve Quartz against the content dir.
  • The CLI is exposed via npm run quartz / npx quartz ... and reads custom config/theme in quartz.config.ts plus layout definition in quartz.layout.ts.
  • content follows Obsidian conventions (Swedish folder names, embedded PDFs/CSV) and Quartz ignores private/templates per the ignorePatterns value.
  • When editing markdown, keep Obsidian-flavored syntax and frontmatter tags because the quiz importer keys off tags like frågetyp/mcq.

Django Quiz Service

Question Import Pipeline

  • stroma/quiz/utils/importer.py parses Obsidian markdown, infers question type via tags, and stores options/matching_data plus tag slugs; the importer respects file mtimes and tracks stats.
  • stroma/quiz/utils/watcher.py plus stroma/quiz/apps.py spin up a background Watchdog thread on startup (unless running management commands/tests) targeting settings.QUESTION_WATCH_PATH from stroma/settings.py.
  • Management commands uv run python manage.py import_questions [--folder ... --force] and populate_exams live in stroma/quiz/management/commands for bulk ingest/backfilling.
  • The importer expects spoiler blocks for answers and tags like frågetyp/mcq; missing answers mark the file as TODO and skip DB writes, so keep metadata consistent.

File Uploads & Assets

Session & Request Patterns

Testing & Tooling

Coding Conventions

  • Follow stroma/AGENT.md: Obsidian-flavored Markdown, no extra docstrings/comments unless asked, favor early returns, narrow try/except, and keep regexes as upper-case _RE constants with inline comments.
  • Use type hints everywhere, prefer function-based Django views, and leverage django-stubs/pytest-django for typing/tests.
  • When working in markdown ingestion, maintain tag-driven semantics (frågetyp/*, completion stats) and keep regex patterns centralized in parser modules.
  • Tests should live beside implementations (e.g., quiz/utils/tests) and use parametrized pytest subtests when iterating over inputs.
  • Keep new dependencies declared in pyproject.toml (Python) or package.json (Quartz) and prefer latest stable versions unless compatibility dictates otherwise.