{"id":36945331,"url":"https://github.com/jsv4/docxodus","last_synced_at":"2026-05-31T04:00:49.293Z","repository":{"id":327172255,"uuid":"1104173770","full_name":"JSv4/Docxodus","owner":"JSv4","description":"Office XML Redline Engine Based on OpenXML SDK (Forked from OpenXMLTools)","archived":false,"fork":false,"pushed_at":"2026-05-29T01:47:27.000Z","size":31330,"stargazers_count":19,"open_issues_count":8,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-29T02:25:11.642Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JSv4.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-25T21:23:53.000Z","updated_at":"2026-05-29T01:47:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/JSv4/Docxodus","commit_stats":null,"previous_names":["jsv4/docxodus"],"tags_count":56,"template":false,"template_full_name":null,"purl":"pkg:github/JSv4/Docxodus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSv4%2FDocxodus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSv4%2FDocxodus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSv4%2FDocxodus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSv4%2FDocxodus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JSv4","download_url":"https://codeload.github.com/JSv4/Docxodus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JSv4%2FDocxodus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33718446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-13T11:17:51.993Z","updated_at":"2026-05-31T04:00:49.288Z","avatar_url":"https://github.com/JSv4.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docxodus-mono-final.svg\" alt=\"Docxodus\" width=\"400\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eA powerful Typescript, Python and .NET library for manipulating Open XML documents (DOCX, XLSX, PPTX).\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/JSv4/Docxodus/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/JSv4/Docxodus/actions/workflows/ci.yml/badge.svg\" alt=\"CI\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"License: MIT\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\nDocxodus is a fork of [Open-Xml-PowerTools](https://github.com/OfficeDev/Open-Xml-PowerTools) upgraded to .NET 8.0. It provides tools for comparing Word documents, converting between DOCX and HTML, projecting DOCX to anchor-addressed markdown for LLM pipelines, programmatically editing DOCX content via a stateful session API, merging documents, and more.\n\n## Quick Start\n\n### Install the Library\n\n```bash\n# Install from NuGet\ndotnet add package Docxodus\n```\n\n### Using as a Library\n\n```csharp\nusing Docxodus;\n\n// Compare documents\nvar original = new WmlDocument(\"original.docx\");\nvar modified = new WmlDocument(\"modified.docx\");\n\nvar settings = new WmlComparerSettings\n{\n    AuthorForRevisions = \"Redline\",\n    DetailThreshold = 0\n};\n\nvar result = WmlComparer.Compare(original, modified, settings);\n\n// Get list of revisions (with move detection)\nvar revisions = WmlComparer.GetRevisions(result, settings);\nforeach (var rev in revisions)\n{\n    if (rev.RevisionType == WmlComparer.WmlComparerRevisionType.Moved)\n        Console.WriteLine($\"Moved (group {rev.MoveGroupId}): {rev.Text}\");\n    else\n        Console.WriteLine($\"{rev.RevisionType}: {rev.Text}\");\n}\n\n// Save the redlined document\nresult.SaveAs(\"redline.docx\");\n```\n\n## CLI Tools\n\nDocxodus includes two command-line tools:\n\n### Redline (Document Comparison)\n\n```bash\n# Install globally\ndotnet tool install -g Redline\n\n# Usage\nredline original.docx modified.docx output.docx\n\n# With custom author tag\nredline original.docx modified.docx output.docx --author=\"Legal Review\"\n```\n\n| Option | Description |\n|--------|-------------|\n| `--author=\u003cname\u003e` | Author name for tracked changes (default: \"Redline\") |\n| `-h, --help` | Show help message |\n| `-v, --version` | Show version information |\n\n### docx2html (HTML Conversion)\n\n```bash\n# Install globally\ndotnet tool install -g Docx2Html\n\n# Basic conversion\ndocx2html document.docx\n\n# Specify output file\ndocx2html document.docx output.html\n\n# Extract images to files instead of embedding as base64\ndocx2html document.docx --extract-images\n\n# Use inline styles instead of CSS classes\ndocx2html document.docx --inline-styles\n```\n\n| Option | Description |\n|--------|-------------|\n| `--title=\u003ctext\u003e` | Page title (default: document title or filename) |\n| `--css-prefix=\u003ctext\u003e` | CSS class prefix (default: \"pt-\") |\n| `--inline-styles` | Use inline styles instead of CSS classes |\n| `--extract-images` | Save images to separate files instead of embedding |\n| `-h, --help` | Show help message |\n| `-v, --version` | Show version information |\n\n## Download Standalone Binaries\n\nPre-built binaries are available on the [Releases](https://github.com/JSv4/Docxodus/releases) page:\n\n**redline** (Document Comparison):\n\n| Platform | Download |\n|----------|----------|\n| Windows (x64) | `redline-win-x64.exe` |\n| Linux (x64) | `redline-linux-x64` |\n| macOS (x64) | `redline-osx-x64` |\n| macOS (ARM) | `redline-osx-arm64` |\n\n**docx2html** (HTML Conversion):\n\n| Platform | Download |\n|----------|----------|\n| Windows (x64) | `docx2html-win-x64.exe` |\n| Linux (x64) | `docx2html-linux-x64` |\n| macOS (x64) | `docx2html-osx-x64` |\n| macOS (ARM) | `docx2html-osx-arm64` |\n\n## Build from Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/JSv4/Docxodus.git\ncd Docxodus\n\n# Build\ndotnet build Docxodus.sln\n\n# Run the CLI\ndotnet run --project tools/redline/redline.csproj -- --help\n```\n\n## Testing\n\n### .NET Unit Tests\n\n```bash\n# Run all tests (~1,100 tests)\ndotnet test Docxodus.Tests/Docxodus.Tests.csproj\n\n# Run specific test by name\ndotnet test --filter \"FullyQualifiedName~WC001\"\n\n# Run tests for a specific class\ndotnet test --filter \"FullyQualifiedName~WmlComparerTests\"\n```\n\n### npm/WASM Browser Tests (Playwright)\n\n```bash\n# Need to be in npm subdirectory\ncd npm\n\n# Install dependencies (first time only)\nnpm install\nnpx playwright install chromium\n\n# Build WASM and TypeScript (required before tests)\nnpm run build\n\n# Run all Playwright tests (~62 tests)\nnpm test\n\n# Run specific test by name pattern\nnpx playwright test --grep \"Document Structure\"\n\n# Run tests with browser visible\nnpx playwright test --headed\n\n# TypeScript type checking\nnpx tsc --noEmit\n```\n\n## Features\n\n- **WmlComparer** - Compare two DOCX files and generate redlines with tracked changes\n  - **Move Detection** - Automatically detects when content is relocated (not just deleted and re-inserted)\n  - **Format Change Detection** - Detects formatting-only changes (bold, italic, font size, etc.)\n  - Configurable similarity threshold and minimum word count\n  - Links move pairs via `MoveGroupId` for easy tracking\n- **WmlToHtmlConverter** / **HtmlToWmlConverter** - Bidirectional DOCX ↔ HTML conversion\n  - Comment rendering (endnote-style, inline, or margin)\n  - Paginated output mode for PDF-like viewing\n  - Headers, footers, footnotes, and endnotes support\n  - Custom annotation rendering\n- **WmlToMarkdownConverter** - Anchor-addressed markdown projection of a DOCX with stable per-block IDs - a text view suitable for LLM editing pipelines, structured search indexers, and diff/review UIs\n- **DocxSession** - Stateful in-memory DOCX editor keyed by markdown-projection anchor ids - the write-side counterpart to WmlToMarkdownConverter for agentic editing pipelines\n  - Text and structural edits: replace paragraph text, delete blocks, insert/split/merge paragraphs, change paragraph style, adjust list level, replace table-cell content\n  - Character-range formatting (bold, italic, underline, strike, code, color, run style) addressed by substring, span, or a prior search match\n  - Surgical text replacement that preserves per-run formatting on either side of the rewritten slice - including a span-addressed variant that lets identical placeholders in one paragraph each receive distinct values\n  - Cross-run text search with per-fragment run breakdown (`Grep`), plus a cross-block variant (`GrepCrossBlock`) that lets a single match span adjacent paragraphs, headings, and list items\n  - Template-slot enumeration that classifies bracketed regions as value blanks, alternative clauses, or drafter hints\n  - Anchor discovery by text, regex, kind, bookmark, annotation id, or shared label - so an agent told to \"edit the indemnification clause\" can resolve intent to anchors without re-walking the document\n  - NBSP / smart-quote handling so common Word whitespace and punctuation don't sabotage literal find/replace\n  - Tracked-change mode that lands every mutation as `w:ins` / `w:del` instead of accepted edits\n  - Bounded snapshot undo/redo\n  - Raw OOXML escape hatch for content the markdown subset can't express (charts, equations, content controls)\n  - Typed result envelope on every call - no exceptions across the API boundary\n  - Available in .NET, WASM, and an npm TypeScript wrapper\n- **DocumentBuilder** - Merge and split DOCX files\n- **DocumentAssembler** - Template population from XML data\n- **PresentationBuilder** - Merge and split PPTX files\n- **SpreadsheetWriter** - Simplified XLSX creation API\n- **OpenXmlRegex** - Search/replace in DOCX/PPTX using regular expressions\n- **OpenContractExporter** - Export documents to OpenContracts format for NLP/document analysis\n- Supporting utilities for document manipulation\n\n## Browser/JavaScript Usage (npm)\n\nDocxodus is also available as an npm package for client-side usage via WebAssembly:\n\n```bash\nnpm install docxodus\n```\n\n```javascript\nimport {\n  initialize,\n  convertDocxToHtml,\n  compareDocuments,\n  getRevisions,\n  getDocumentMetadata,\n  isMove,\n  isMoveSource,\n  isFormatChange,\n  findMovePair,\n  CommentRenderMode,\n  PaginationMode\n} from 'docxodus';\n\nawait initialize();\n\n// Convert DOCX to HTML with comments and pagination\nconst html = await convertDocxToHtml(docxFile, {\n  commentRenderMode: CommentRenderMode.EndnoteStyle,\n  paginationMode: PaginationMode.Paginated,\n  renderHeadersAndFooters: true\n});\n\n// Compare two documents\nconst redlinedDocx = await compareDocuments(originalFile, modifiedFile);\n\n// Get revisions with move and format change detection\nconst revisions = await getRevisions(redlinedDocx);\nfor (const rev of revisions) {\n  if (isMove(rev)) {\n    const pair = findMovePair(rev, revisions);\n    if (isMoveSource(rev)) {\n      console.log(`Content moved from: \"${rev.text}\" to: \"${pair?.text}\"`);\n    }\n  } else if (isFormatChange(rev)) {\n    console.log(`Format changed: ${rev.formatChange?.changedPropertyNames?.join(', ')}`);\n  }\n}\n\n// Get document metadata for lazy loading\nconst metadata = await getDocumentMetadata(docxFile);\nconsole.log(`${metadata.totalParagraphs} paragraphs, ${metadata.estimatedPageCount} pages`);\n```\n\nSee the [npm package documentation](docs/npm-package.md) for full API reference, React hooks, and usage examples.\n\n## Requirements\n\n- .NET 8.0 or later\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n---\n\n*Built on the shoulders of [Open-Xml-PowerTools](https://github.com/OfficeDev/Open-Xml-PowerTools). Thanks to Eric White, Thomas Barnekow, and all original contributors.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsv4%2Fdocxodus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsv4%2Fdocxodus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsv4%2Fdocxodus/lists"}