Skip to content

Add deterministic Pandoc conversion core#9

Merged
llbbl merged 1 commit into
mainfrom
issue-2-pandoc-conversion
Jul 25, 2026
Merged

Add deterministic Pandoc conversion core#9
llbbl merged 1 commit into
mainfrom
issue-2-pandoc-conversion

Conversation

@llbbl

@llbbl llbbl commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a typed Pandoc 3.x conversion surface for deterministic Markdown-to-DOCX output
  • cover conversion behavior with unit tests, a normalized golden XML fixture, and a reference DOCX fixture
  • document the public API, reproducibility contract, and Pandoc expectations for consumers

Tests

  • pnpm format:check
  • pnpm lint
  • pnpm typecheck
  • pnpm test (19 passed, 1 expected skipped)
  • pnpm build
  • pnpm pack --dry-run
  • built a real Pandoc 3.10 conversion
  • pnpm audit

Design notes

  • SOURCE_DATE_EPOCH is forwarded to Pandoc so identical inputs can produce reproducible DOCX bytes.
  • --wrap=none and --markdown-headings=atx are intentionally omitted because they affect Markdown output, not DOCX writing.

Residual risks

  • Byte-for-byte reproducibility still depends on the installed Pandoc binary and the reference DOCX remaining stable.

Closes #2

Shell out to Pandoc behind a typed conversion contract so callers can\nproduce reproducible DOCX bytes without embedding CLI behavior.\n\n• Enforce Pandoc 3.x probing and fail-closed validation before conversion\n• Add deterministic golden-fixture coverage around SOURCE_DATE_EPOCH and\n  reference-doc handling\n• Document why DOCX conversion omits Markdown-only wrap and heading flags
@llbbl
llbbl merged commit 82d76d3 into main Jul 25, 2026
@llbbl
llbbl deleted the issue-2-pandoc-conversion branch July 25, 2026 18:30
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.

Conversion core: md → docx (pandoc + reference.docx)

1 participant