What
Add odt as a supported output format (-f odt), following the pattern
documented in CONTRIBUTING.md / README.md "Adding a new output format".
Why
OpenDocument Text is the native format for LibreOffice/OpenOffice, and
required in some EU/government contexts. Overlaps with DOCX (#8) as an
"editable office doc" target — niche relative to DOCX's Word audience, but
same zip-of-XML approach, no external dependency needed (pure Go).
Approach
- New package
internal/converter/odt/odt.go.
- Implement
converter.Converter, mapping the goldmark AST (headings,
paragraphs, lists, code blocks, tables, bold/italic/links) to
content.xml + supporting parts (mimetype, META-INF/manifest.xml,
styles.xml, meta.xml).
init() calls converter.Register("odt", Converter{}).
- Blank-import the package in
main.go.
- Tests under
internal/converter/odt/ — at minimum, assert the output is
a valid zip with expected parts, spot-check rendered text content.
- Add
odt to the formats table in README.md.
Note: mimetype file must be the first zip entry, stored uncompressed
(ODF spec requirement) — differs from DOCX's zip layout, watch for this.
No CLI changes needed — -f odt works automatically once registered.
What
Add
odtas a supported output format (-f odt), following the patterndocumented in CONTRIBUTING.md / README.md "Adding a new output format".
Why
OpenDocument Text is the native format for LibreOffice/OpenOffice, and
required in some EU/government contexts. Overlaps with DOCX (#8) as an
"editable office doc" target — niche relative to DOCX's Word audience, but
same zip-of-XML approach, no external dependency needed (pure Go).
Approach
internal/converter/odt/odt.go.converter.Converter, mapping the goldmark AST (headings,paragraphs, lists, code blocks, tables, bold/italic/links) to
content.xml+ supporting parts (mimetype,META-INF/manifest.xml,styles.xml,meta.xml).init()callsconverter.Register("odt", Converter{}).main.go.internal/converter/odt/— at minimum, assert the output isa valid zip with expected parts, spot-check rendered text content.
odtto the formats table in README.md.Note:
mimetypefile must be the first zip entry, stored uncompressed(ODF spec requirement) — differs from DOCX's zip layout, watch for this.
No CLI changes needed —
-f odtworks automatically once registered.