Skip to content

docx2html: add --track-changes and story rendering flags#269

Merged
JSv4 merged 1 commit into
mainfrom
claude/docx-redlines-github-action-fh2yma
Jul 12, 2026
Merged

docx2html: add --track-changes and story rendering flags#269
JSv4 merged 1 commit into
mainfrom
claude/docx-redlines-github-action-fh2yma

Conversation

@JSv4

@JSv4 JSv4 commented Jul 12, 2026

Copy link
Copy Markdown
Owner

The docx2html CLI always accepted revisions before converting (the RenderTrackedChanges = false default), so a redline document rendered as if every change had already been applied — there was no way to preview a redline in a browser from the command line, even though WmlToHtmlConverter has supported it for a long time.

This adds CLI flags mapping straight onto the existing WmlToHtmlConverterSettings (no library changes):

Flag Setting
--track-changes RenderTrackedChanges = true — render revisions as ins/del/move markup
--no-render-moves RenderMoveOperations = false — lower move markup to plain ins/del
--render-comments RenderComments = true
--render-footnotes RenderFootnotesAndEndnotes = true
--render-headers-footers RenderHeadersAndFooters = true

Defaults are unchanged (all off, moves on), so existing invocations behave identically. Tool version const bumped to 1.1.0; CHANGELOG entry under [Unreleased] (an ### Added entry, so the next release is a minor per the release process).

Motivation

This is the preview half of the docx-redlines GitHub Action requested in JSv4/Python-Redlines#12 and implemented in JSv4/Python-Redlines#27: the action redlines the .docx files a PR changes using the redline CLI, then runs docx2html --track-changes over each redline to publish browser-viewable previews alongside the .docx artifacts. The action's html-preview: auto mode probes docx2html --help for --track-changes, so it lights up automatically once this lands in a NuGet release of the Docx2Html tool.

Verification

Built with the .NET 10 SDK and exercised over TestFiles/WC/WC001-Digits{,-Mod}.docx:

  • redline reports 4 revisions on the pair.
  • Converting the redline without the flag: 0 ins/del elements (revisions accepted — prior behavior, unchanged).
  • Converting with --track-changes: 4 ins/del elements with the converter's tracked-changes CSS.

The flags are thin passthroughs to converter settings already covered by HtmlConverterTests; the CLI tools have no test project, matching the existing pattern for tools/.


Generated by Claude Code

The docx2html CLI always accepted revisions before converting, so a redline
document rendered as if every change had been applied — there was no way to
preview a redline in a browser. Add flags mapping straight onto the existing
WmlToHtmlConverterSettings:

  --track-changes           render revisions as ins/del/move markup
  --no-render-moves         lower move markup to plain ins/del
  --render-comments         render document comments
  --render-footnotes        render footnotes and endnotes
  --render-headers-footers  render document headers and footers

Defaults are unchanged (all off, moves on), so existing invocations behave
identically. This is the preview half of the docx-redlines GitHub Action
(JSv4/Python-Redlines#12): the action redlines changed .docx files with the
redline CLI and uses docx2html --track-changes to publish browser-viewable
previews.

Verified: redline over WC001-Digits fixtures reports 4 revisions; converting
that output without the flag yields 0 ins/del elements (revisions accepted,
prior behavior), with --track-changes yields 4.
@JSv4 JSv4 merged commit cb1679e into main Jul 12, 2026
12 checks passed
@JSv4 JSv4 deleted the claude/docx-redlines-github-action-fh2yma branch July 12, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants