frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: DOM-docx – HTML to native, editable Word docs (MIT)

https://github.com/floodtide/dom-docx
20•fishbone•1h ago

Comments

fishbone•1h ago
Hey HN, author here.

I do a lot of backend document (docx file) generation work, and updating our templates and backend code is one of my least favorite development tasks. Cryptic errors, minute-plus rebuild loops. I’d much prefer building these reports in JS rendered HTML (e.g., Vue or React), but existing HTML-to-docx libraries in the OSS ecosystem don't produce output that's actually valid, editable Word structure.

I'd had good luck applying Karpathy's Autoresearch pattern (agent runs iterations against an objective score, keeps what improves, discards what doesn't) to a couple of other problems, and figured OOXML fidelity was a good fit.

The Autoresearch process goes like this: render HTML and take a screenshot, use dom-docx to convert to docx, rasterize the docx file with LibreOffice and take another screenshot, score the browser HTML screenshot vs LibreOffice screenshot and measure layout fidelity + editability + speed as a quality metric, feed score back in, and repeat to drive higher fidelity within the constraints of editability and performance. It’s a beautiful thing to watch.

Burned some tokens and ran that loop against 37 real-world HTML patterns such as nested lists, tables, flex layouts and blockquotes (stuff that often breaks converters) and "brute forced" my way to what I hope is a high-fidelity HTML to docx converter.

A few things about where it landed:

- Native OOXML output, real Word structure, not a screenshot or a 1x1 table pretending to be a document - Works in Node, in the browser (no Playwright needed for the default path), and as a CLI (npx dom-docx input.html -o output.docx) - MIT licensed - Full benchmark methodology + results vs the established OSS alternatives: https://github.com/floodtide/dom-docx/blob/main/docs/BENCHMA...

Live demo if you want to test HTML conversion in the browser: https://dom-docx.com

Happy to answer anything about the scoring loop or anything else.

PS: This is the first thing I've open sourced and I'm excited to see where it leads!

Octoth0rpe•48m ago
That's an interesting approach. I'm concerned about the use of LibreOffice as your source of truth. Would it be possible to swap out LibreOffice for actual MS Word in this workflow? This also could reveal some libreoffice rendering bugs/edge cases that are worth filing bugs over.
fishbone•27m ago
I don’t have MS word installed on my development machine, so I haven’t done much testing with Word, but that does sound like a good idea to run the suite using Word. For what it’s worth I did not notice any issues with LibreOffice, even after running many iterations and tests.
noufalibrahim•40m ago
Surely I can't be the only one who misread the heading and clicked expecting to see DOOM implemented using just HTML DOM. :-/
_fzslm•16m ago
For that you probably want this, lol: https://cssdoom.wtf/
alansaber•11m ago
Pretty sure that has been done. I clicked to see DOOM implemented using OOXML.
virajk_31•13m ago
I have done something similar for PPTX, keeping the fidility intact was really challenging with computed values & OOXML counterparts and again challanges with different XML implementations like that of MS & Libre..
fishbone•5m ago
Agreed, visual fidelity is pretty hard, and that’s why none of the scores are 100.

Zig Creator Calls Spade a Spade, Anthropic Blows Smoke

https://raymyers.org/post/zed-creator-calls-spade-a-spade/
672•crowdhailer•4h ago•324 comments

A voxel Tokyo in real Japan time – ride the Yamanote line and study Japanese

https://jivx.com/densha
75•momentmaker•1h ago•5 comments

Control the Ideas, Not the Code

https://antirez.com/news/169
40•surprisetalk•1h ago•4 comments

Show HN: DOM-docx – HTML to native, editable Word docs (MIT)

https://github.com/floodtide/dom-docx
21•fishbone•1h ago•8 comments

Interrail: 6,379Km and 13 Countries over 7 weeks

https://shkspr.mobi/blog/2026/07/another-ridiculous-interrail-holiday-6379km-and-13-countries-ove...
125•coinfused•5h ago•71 comments

The social physics of conversation: Communication patterns matter

https://andiroberts.com/citizenship/the-social-physics-of-conversation-citizenship-leadership
87•kiyanwang•5d ago•16 comments

GhostLock, a stack-UAF that has existed in all Linux distributions for 15 years

https://nebusec.ai/research/ionstack-part-2/
323•ranger_danger•4d ago•141 comments

Backtrack-Free Cursive

https://mmapped.blog/posts/52-backtrack-free-cursive
126•dmit•7h ago•59 comments

An Infuriating Goodbye to Photoshop

https://anderegg.ca/2026/07/12/an-infuriating-goodbye-to-photoshop
59•ExMachina73•1h ago•29 comments

Cyberpunk Comics, Manga and Graphic Novels

https://shellzine.net/cyberpunk-comics/
238•zdw•14h ago•89 comments

Beavis Ultrasound PnP ISA Sound Card Replica

https://github.com/schlae/BeavisUltrasound
78•mariuz•7h ago•26 comments

Tiny Emulators

https://floooh.github.io/tiny8bit-preview/index.html
293•naves•16h ago•25 comments

The Graph That Should Be Front-Page News

https://www.lyrebirddreaming.com/post/the-graph-that-should-be-front-page-news
230•rakel_rakel•7h ago•145 comments

So you want to learn physics (second edition, 2021)

https://www.susanrigetti.com/physics
266•azhenley•5d ago•45 comments

Leak of San Francisco Police Drone Footage Exposes Reality of Urban Surveillance

https://www.wired.com/story/sfpd-drone-video-leak-surveillance/
21•nozzlegear•1h ago•12 comments

How to read more books

https://scotto.me/blog/2026-07-12-how-to-read-more-books/
434•silcoon•21h ago•216 comments

Designing and assembling my first PCB

https://vilkeliskis.com/b/2026/0711.html
135•tadasv•14h ago•69 comments

Frieve Vinyl Explained – Microscopic stylus/groove physics simulation

https://frieve-a.github.io/sound_toolbox/vinyl_explained/vinyl_explained.html
35•XzetaU8•4d ago•3 comments

The 'absolute magic' of Morse code that still connects people globally

https://www.bbc.com/news/articles/cwye0dlzgejo
5•austinallegro•4d ago•0 comments

We Put an L7 Firewall in the Kernel

https://yeet.cx/blog/l7-firewall-in-the-kernel
32•ok_major_9889•3d ago•4 comments

Ask HN: What Are You Working On? (July 2026)

180•david927•15h ago•599 comments

LARP – Revenue infrastructure for serious founders

https://www.larp.website/
280•BerislavLopac•20h ago•55 comments

Ask HN: Add flag for AI-generated articles

799•levkk•11h ago•353 comments

Vint Cerf, “father of the Internet”, is retiring

https://techcrunch.com/2026/06/30/the-father-of-the-internet-is-finally-retiring/
332•compiler-guy•3d ago•185 comments

Sam Neill has died

https://www.theguardian.com/film/2026/jul/13/sam-neill-death-actor-dies-aged-78
272•j4mie•7h ago•63 comments

Migrating a production AI agent to GPT-5.6: 2.2x faster, 27% cheaper

https://ploy.ai/blog/migrating-a-production-ai-agent-to-gpt-5-6
221•brryant•20h ago•99 comments

Kode Dot Programmable pocket device for makers, pentesters and geeks

https://kode.diy
97•iNic•15h ago•25 comments

Claude Code sends 33k tokens before reading the prompt; OpenCode sends 7k

https://systima.ai/blog/claude-code-vs-opencode-token-overhead
637•systima•18h ago•336 comments

Are you telling me a readonly property is wrecking my performance?

https://shub.club/writings/2026/july/check-your-scrollheight/
44•forthwall•3d ago•24 comments

How we can reduce traffic congestion

https://research.google/blog/the-power-of-collaboration-how-we-can-reduce-traffic-congestion/
153•raahelb•21h ago•255 comments