Recent submissions

Comment · 3 months ago
I fixed this issue. The dom-docx.com Live Converter "Try in the browser" page was running an older version of the dom-docx package from before Page Breaks were added as a feature. I've updated it to the latest version.
Comment · 3 months ago
Comment · 3 months ago
I hear you, thanks for the feedback. I've done that some already but of course it could be better in more of my own voice.
Comment · 3 months ago
Ok, I dug into the Red Hat doc. It’s a great example and it uncovered a few real shortcomings.

A couple of things about this scenario:

First, the page relies on stylesheets, so you need styleSource: "computed", either Playwright on Node, or run in the browser with the content already rendered.

Second, dom-docx doesn’t fetch remote images itself. The caller supplies an imageResolver (e.g. a fetch callback), which keeps security, timeouts, host allowlists, etc. under caller control: https://dom-docx.com/learn#image-resolver

I fixed a few bugs from this (in 0.1.8):

- wide headings inside flex containers getting clipped

- oversized images not scaling down to the printable page width

- OS dark theme (prefers-color-scheme: dark) leaking near-white computed text colors into Word on the browser path

I also added an ad-hoc repo script that loads a live URL, takes a CSS selector, and converts with Playwright (tools/try-url.ts). I used it on the RHEL page and got a pretty decent 200+ page doc. Some tables still look wrong — I’ll dig into those next.

Script: https://github.com/floodtide/dom-docx/blob/main/tools/try-ur...

Example usage from a clone: npx tsx tools/try-url.ts \ "https://docs.redhat.com/en/documentation/red_hat_enterprise_..." \ ".docs-content-container" \ rhel-storage.docx

Comment · 3 months ago
Since HTML is so rich and the DX is amazing these days, I wish HTML file sharing for the document use case (and using the browser as a client) was widely accepted, it’s another problem/opportunity I’ve pondered a lot.
Comment · 3 months ago
Not yet, but I’ve actually thought about that and want to investigate that possibility at some point!
Comment · 3 months ago
Scoring would probably be the big difference because the outcome is to optimize performance or optimize a score or a metric versus just a pass fail.
Comment · 3 months ago
I did everything with the Cursor $20 plan and the Claude Code $20 plan, so in this particular case it wasn’t actually that many tokens. This was over the course of about four weeks of weekend and evening work.
Comment · 3 months ago
All of the suite test cases are small fragments of HTML to test specific things, so I probably do need a way to test bigger documents. Thanks for the feedback. I’ll add that to the to-do list.

I’ll try the red hat example later this evening.

Comment · 3 months ago
Comment · 3 months ago
Thanks for the feedback, I’ll add Word validation to my todo list.
Comment · 3 months ago
Agreed, visual fidelity is pretty hard, and that’s why none of the scores are 100.
Comment · 3 months 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.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton