Document Comparator
Compare two documents to identify text differences, structural changes, and similarity.
Usage
/doc-comparator --compare <file1> <file2> [--format text|json|html]
/doc-comparator --summary <file1> <file2>
Supported Formats
- Text/Markdown: Line-by-line comparison
- DOCX: Extracts text via mammoth, then compares
- PDF: Extracts text via pdf-parse, then compares
- HTML: Strips tags, then compares text content
Output Formats
- text (default): Unified diff format
- json: Structured change objects
- html: HTML with highlighted changes
Dependencies
mammoth— DOCX text extractionpdf-parse— PDF text extraction