LegalDown v0.1
First published version of the LegalDown specification — a plain-text markup language for legal documents. A CommonMark superset with legal-specific constructs: structured sections, stable cross-references, defined terms, typed field specs, and party references, so legal documents are human-readable, machine-parseable, and version-control native.
Highlights
- No hardcoded numbers, ever. Section numbering, list enumeration, and cross-reference text are generated at render time — reorder freely, nothing breaks. Anchors work on headings, list items, and paragraphs, so clause-level references ("Section 4.2(b)") stay stable too.
- Definitions the way lawyers write them — in a definitions article or inline at first use, with eight quotation-mark conventions covering the major Western legal languages.
- A formal directive grammar with quoted values and defined recognition contexts, and a deterministic identifier algorithm, so independent implementations agree byte-for-byte.
- 98 validation rules with stable rule ids (
heading-skip,ref-broken,include-cycle…), each with a severity and a conformance level (Core / Rendering / Full). - Bilingual documents as linked files with a primary/translation model; amendments that import the original's definitions; includes and attachments on one shared fragment model; templates via inline and frontmatter placeholders.
In this repository
spec/legaldown-spec.md |
The specification (18 sections) |
llm/legaldown-spec-llm.md |
Condensed reference for language models |
examples/ |
Working documents — a simple tier and an advanced tier exercising every feature |
fixtures/ |
Conformance corpus: 95 cases, one per mechanically testable validation rule |
CONTRIBUTING.md |
How to propose changes |
Status
v0.1 is an early draft standard: complete and internally consistent, published to gather implementation experience and community feedback. Breaking changes remain possible before v1.0 and will be recorded in the CHANGELOG with migration notes. Deliberate deferrals are listed in the specification's §18 (Roadmap and Known Limitations).
Feedback via Discussions; errors and ambiguities via Issues.
The specification is licensed under CC BY 4.0. Implementations may use any license.