Skip to content

Add ODT output format #27

Description

@rapatao

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

  1. New package internal/converter/odt/odt.go.
  2. 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).
  3. init() calls converter.Register("odt", Converter{}).
  4. Blank-import the package in main.go.
  5. Tests under internal/converter/odt/ — at minimum, assert the output is
    a valid zip with expected parts, spot-check rendered text content.
  6. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions