The C4 annotation schema is the source of truth for what annotations are supported and how they work.
c4-annotations-schema.yaml ← Edit this (source of truth)
SCHEMA.md ← Generated (do not edit directly)
generate_schema_docs.py ← Generator script
-
Edit the schema:
# Edit the YAML file vim c4-annotations-schema.yaml -
Generate documentation:
make docs # or python3 generate_schema_docs.py -
Commit both files:
git add c4-annotations-schema.yaml SCHEMA.md git commit -m "Add new @c4-foo annotation"
- YAML = Source of truth, easy to edit, supports comments
- Markdown = User-friendly documentation, linkable, renderable on GitHub
- Script = Keeps them in sync automatically
In CI, we verify SCHEMA.md is up to date:
make check-docsThis prevents merging PRs where someone forgot to regenerate.
# Run all tests
pytest
# Run specific test file
pytest tests/test_parser.py
# With coverage
pytest --cov=c4_literate# Install in development mode
pip install -e .
# Build wheel
python -m buildREADME.md- Main project READMESCHEMA.md- Auto-generated annotation referencedocs/ADR-*.md- Architecture decision recordsUSAGE_EXAMPLE.md- Example usage with notes-apiCONTRIBUTING.md- Contribution guidelines