Show HN: Rudoc – a 4.5MB Rust document converter

github.com

16 points by sideras56 a day ago

I built Rudoc because I wanted a smaller tool for simple file convertion workflow. (Pandoc was so heavy for me) I once wanted to try Pandoc, but after I downloaded it from GitHub, I found that it is around 70 MB. It also needed a lot of dependencies.

Rudoc is not a substitue of Pandoc, it supports limited set of formats (only txt, md, html, typ, docx, pdf, pptx, xml, json) and doesn't support advanced formatting. The most common workflow is just turn a markdown file to a html. PDF generation can work without Typst, but PDF input conversion requires Typst as a backend. It has no other runtime dependencies and can run as a single binary, by the way.

It is pretty easy to use, just use the format of rudoc input.file output.file One sample usage is like this: ```powershell rudoc OhPDF_ROADMAP.md.txt r.md [rudoc] OhPDF_ROADMAP.md.txt → r.md (txt→md) [rudoc] done in 52ms (6286 bytes) rudoc r.md r.html [rudoc] r.md → r.html (md→html) [rudoc] done in 4ms (7363 bytes) ```

Some complex formats (such as pptx) still have limited compatibility. I planned to add standard error messages and better format compatibilities. I'd be pleased to see feedback or issues on my project.

QA: Why not Pandoc? Pandoc is a great tool, but sometimes we only need a convenient little one to handle common conversion tasks.

How compatible is it to docx/pptx? Currently it supports basic text conversion, and I'm trying to make it be able to keep advanced formatting.

tstenner 11 hours ago

The comparison to pandoc seems needlessly hostile. Most users get pandoc as a standalone binary (e.g. the Debian package).

Pandoc is a bit on the larger size, but for what it offers (templating, lua filters, built-in templates for all supported markup languages) it is entirely reasonable.

  • sideras56 11 hours ago

    That's fair, but I didn't mean to critisize Pandoc, it was an excellent tool. My point was that for my own use cases, I wanted a much smaller standalone binary for simple conversions. Rudoc is more focused on a narrower scope.