Skip to content

feat(docx): improve docx tool — proper rich formatting instead of markdown wrapping #45

Description

@EngineerProjects

Context

The current docx tool (internal/tools/special/docx/) generates .docx files by wrapping markdown content using docxgo. In practice this produces documents that are essentially plain markdown wrapped in a Word container, without leveraging Word's native rich-text capabilities.

The tool has been disabled (removed from builtin.go) until a proper implementation is available.

What needs to be done

  • Implement proper markdown → DOCX conversion that produces native Word formatting:
    • Headings → Word Heading 1/2/3 styles
    • Bold/italic → native character formatting
    • Tables → Word tables with proper column widths
    • Code blocks → monospace styled paragraphs
    • Lists → Word native list styles
  • Consider using a more capable library (e.g. unioffice, go-docx, or calling pandoc as a subprocess when available)
  • Add proper read action that extracts text from existing .docx files (currently relies on docling-serve)
  • Re-enable the tool in builtin.go once the output quality is acceptable
  • Add integration tests with fixture .docx files

Current implementation

File: internal/tools/special/docx/docx.go
Uses: github.com/mmonterroca/docxgo/v2

The tool was registered in internal/tools/builtin/builtin.go — removed in the commit that created this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions