Repository navigation
v0.4.0 — Model core
v0.4.0 — Model core (road to 1.0, milestone 1)
First of several milestones on the way to a stable 1.0. This release enriches the in-memory document model with elements that real-world DOCX, HTML, and Markdown files rely on but that paperdoc-lib could not previously represent.
Non-breaking: no existing signatures change, no renderer/parser behaviour changes. Parsers and renderers will be taught the new elements in follow-up
v0.5.xreleases.
New block elements
| Element | Highlights |
|---|---|
ListBlock + ListItem |
Bullet / ordered, nested lists, custom starting number, styled item labels with link support |
Heading |
Levels 1–6, optional id anchor (TOC/bookmarks), styled runs |
Bookmark |
Named landmark — completes the v0.3.8 hyperlink feature (TextLink::anchor → Bookmark::id) |
CodeBlock |
Verbatim source block with optional language hint |
Blockquote |
Nested-aware quoted block |
Typed document properties
Paperdoc\Document\Metadata— author / subject / description / keywords /createdAt/modifiedAt/ languageDocument::getProperties()/setProperties()— exposed next to the existing loosemetadatakey/value bag
Contracts & error handling
- Marker interfaces —
Paperdoc\Contracts\BlockElementInterfaceandInlineElementInterface(extendDocumentElementInterface) - Existing
Paragraph,Image,PageBreak,Tableretrofitted toBlockElementInterface(non-breaking) - Typed exceptions — new
Paperdoc\Exceptionsnamespace:PaperdocException(base),ParserException,RendererException,UnsupportedFormatException,InvalidDocumentExceptionwith factory helpers
Fluent Section API
$section = Section::make();
$section->addHeading('Getting started', 2);
$section->addBulletList()
->addText('Install')
->addText('Configure')
->addText('Run');
$section->addCodeBlock("composer require paperdoc-dev/paperdoc-lib", 'bash');
$section->addBookmark('setup-done');
$section->addBlockquote()
->addText('You are all set.');Tests
- 80+ new unit tests across
tests/Unit/Document/{ListBlock,ListItem,Heading,Bookmark,CodeBlock,Blockquote,Metadata}Test.phpandtests/Unit/Exceptions/ExceptionsTest.php - Full suite: 531 tests, 1177 assertions, all green
- Fixed a pre-existing risky test in
DocxParserTestthat lacked assertions when the optional fixture was missing
Road to 1.0
- v0.4.0 (this release) — Model core
- v0.5.x — Round-trip robustness (DOCX/XLSX numbering, merged cells, formulas, headers/footers)
- v0.6.x — API stabilisation (
@api/@internalmarkers,finalon value objects) - v0.7.x — Split optional dependencies (Neuron AI moved to suggest / sidecar package)
- v1.0.0-rc → v1.0.0
Install
composer require paperdoc-dev/paperdoc-lib:^0.4Full changelog: v0.3.8...v0.4.0