docspec-oxa-writer
Converts a DocSpec event stream into oxa.dev JSON. Implements the EventSink trait and emits JSON tokens directly to any Write target as events arrive — no intermediate document representation, constant memory regardless of file size.
Supported Features
| Block type | oxa.dev type |
|---|---|
| Paragraph | Paragraph |
| Text | Text |
Not Supported
The following DocSpec events are not yet supported and will be silently ignored:
- Headings —
StartHeading/EndHeading - Block quotes —
StartBlockQuote/EndBlockQuote - Preformatted / code blocks —
StartPreformatted/EndPreformatted - Images —
Image - Tables —
StartTable/EndTableand related events - Thematic breaks —
ThematicBreak - List items —
StartOrderedListItem/StartUnorderedListItemand related events - Inline links —
StartLink/EndLink - Footnotes —
StartFootnote/EndFootnote/FootnoteRef - Definition lists —
StartDefinitionList/StartDefinitionTerm/StartDefinitionDetail - Captions —
StartCaption/EndCaption
Usage
use OxaWriter;
use ;
let mut buf = Vec::new;
let mut writer = new;
writer.handle_event?;
writer.handle_event?;
writer.handle_event?;
writer.handle_event?;
writer.handle_event?;
writer.finish?;
let json = Stringfrom_utf8?;
# Ok::
Limitations
This is a minimal scaffold. Full implementation will follow in subsequent tasks.
License
See the repository LICENSE.