Silurus/ooxml: Pixel-faithful Office documents, rendered in the browser
TL;DR Highlight
A Rust+WASM Office viewer on Canvas, built entirely by AI coding agents
Who Should Read
Frontend or backend developers who want in-browser docx, xlsx and pptx previews without server-side LibreOffice conversion
Core Mechanics
- AI agents wrote all the code
- The README says the Rust parsers, TypeScript renderers, tests and tooling were built mainly by Claude and Codex through iterative prompting.
- It states that no human-written application code exists in the repo.
- A spec plus a reference output suits AI
- OOXML has a written spec (ECMA-376 / ISO-29500), and Word, Excel and PowerPoint serve as the correct answer.
- The author limited scope to viewing to avoid the risk of corrupting user files.
- Rust parsers in WASM, Canvas 2D rendering
- Parsers are written in Rust and compiled to WebAssembly.
- Headless engines (DocxDocument, XlsxWorkbook, PptxPresentation) draw into your own canvas so you can build custom UI.
- Scope is strictly read-only
- Editing UI, mutation APIs and save or round-tripping are out of scope.
- Read-only interactions like selection, copy, search and hit testing are in scope.
- Install and usage are simple
- Run npm install @silurus/ooxml, import DocxViewer, XlsxViewer or PptxViewer, and call load().
- Math (MathJax, ~4MB), ChartEx, 3D charts and TIFF are opt-in modules kept out of the bundle unless imported.
- Selection context for AI/MCP requests
- xlsx.getSelectionContext() returns the selected cells in a serializable read-only form.
- You can cap it with maxCells and maxTextCharacters.
Community Reactions
- Experiences of heavy mismatches on complex files
- One commenter tried medium-complex documents and found rendering wildly wrong.
- Another said it failed on all their internal test files.
- Objections about PPTX gaps
- One commenter said slide image backgrounds and bullet images do not work and some text colors are inverted.
- They also noted the repo itself doesn't claim pixel-faithful rendering.
- XLSX preview impressed one commenter
- A commenter who used server-side headless LibreOffice to PDF said it beats this for PPTX and DOCX.
- They noted this library lacks selectable text, which PDF conversion has.
- They said the XLSX preview, even interactive, blew their mind.
- Bundle sizes and alternatives mentioned
- One commenter measured WASM at docx 458kb (217kb gzip), pptx 574kb (253kb) and xlsx 601kb (269kb).
- Similar projects eigenpal/docx-editor and superdoc-dev/superdoc were mentioned.
How to Apply
- Compare rendering on your own files first
- Today, upload 5 to 10 real docx, pptx and xlsx files from your service to the demo (ooxml.silurus.dev) and compare against Office.
- Check backgrounds, bullets and tables, which commenters flagged.
- Plug the Canvas viewer into your preview feature
- Where you use server PDF conversion, use DocxViewer, XlsxViewer or PptxViewer and pass the file URL to load().
- Keep PDF conversion for screens that require text selection.
- Pass XLSX selection to AI requests
- When a user selects cells, serialize them with getSelectionContext({maxCells}) and put the result in an LLM prompt or MCP request.
- Use maxCells and maxTextCharacters to cap token usage.
- Check bundler and WASM path settings
- On the Vite 7 dev server, add optimizeDeps.exclude for '@silurus/ooxml' in vite.config.
- For esbuild or Angular CLI, copy the .wasm and set the wasmUrl option.
Try It
// In your browser project terminal: npm install @silurus/ooxml
// TypeScript below. Replace the canvas id and file path
import { DocxViewer } from '@silurus/ooxml/docx';
const canvas = document.getElementById('docx-canvas') as HTMLCanvasElement;
const docx = new DocxViewer(canvas);
await docx.load('/document.docx');
docx.nextPage();Terminology
Related Papers
WhatsApp's help pages hid LLM instructions: dont recommend a regulator
WhatsApp help pages hid 102 AI-only instructions, including not recommending a data regulator
Same Simulation, Different Evidence: Where Retrieved Tool Output Costs LLM Agents Accuracy
Saving long tool output to files cut GPT-5.1 accuracy by 11.3 points; naming the authoritative file restored it.
Fake News, Real Crashes: Information Injection Attacks on LLM Financial Trading Agents
Fake headlines hijacked LLM trading agents 62% of the time versus 14% for prompt injection.
Harness Engineering 101: The LLM is the brain, the harness is the body
An agent is a loop managing a JSON array; 16 chapters build one from scratch
Harness2 by Google Research – Recursive Agent Harnessing
Recursively refining the harness with fixed model weights raised benchmark scores by up to 11.8 points.
Ask HN: How to deal with shipping AI-written code you don't understand?
Developers share how they ship AI-written code: design it yourself, let LLMs implement, and test heavily.
Ousted Savannah police officer gave ICE agent husband access to Flock system
A police officer shared her Flock login with her ICE-agent husband; an audit found 983 searches and she was fired
Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
Running Claude Code agents in tmux works well, but limits appear around four agents.