Skip to content

Repository files navigation

Duckling

Duckling converts documents into DocLang, Markdown, JSON or LaTeX, on your own machine, with nothing sent anywhere. Drop in Word, PowerPoint, Excel, PDF, HTML, EPUB, RTF, OpenDocument, Apple iWork, email, Visio and some forty other formats, choose what to convert to and where to put it, and press Convert. Scanned PDFs and images are read by layout and OCR models that ship inside the application, so there is nothing to download after installing.

The converter is docling.rs, the Rust port of IBM's Docling. Duckling is the window around it, and adds no conversion logic of its own.

Build

./packaging/fetch-models.sh     # once; about 750 MB of models and pdfium
cargo build --release

A Rust toolchain and a C compiler build the application: the PDF pipeline links ONNX Runtime, which arrives as a prebuilt static library, and compiles oniguruma from source under the tokenizer docling.rs carries. pdfium is loaded at run time from .pdfium/lib beside the working directory or the executable. DESIGN.md §2 says what those dependencies cost and why they are taken.

On macOS the build is Apple silicon only: no prebuilt ONNX Runtime exists for an Intel Mac. cargo build --release --features intel-mac builds a copy with no runtime in it for such a machine, which converts everything but PDFs and images. packaging/macos/README.md is the whole of it.

On Windows, fetch-models.sh runs under the Git Bash that Git for Windows installs, and the packaged application carries five DLLs beside the executable that no other platform needs — four Visual C++ runtime files, because the prebuilt ONNX Runtime cannot be linked against the static CRT, and DirectML, which that library brings whether or not anything asks for it. packaging/windows/README.md is the whole of it.

Run

cargo run --release -- [FILE|FOLDER ...]

Files and folders given on the command line, dropped on the window, or picked with the buttons are queued. A folder contributes every file under it that docling.rs can read. Nothing is converted until Convert is pressed, so the format and destination chosen at that moment apply to the whole batch. Output goes beside each source file or into one folder, and an existing file is never overwritten: a second report.md becomes report (1).md. A DocLang archive carries a page image per page and the document's pictures, so Segler can show the page beside the text; bare DocLang gets its pictures in an assets/ folder beside the file.

Where things are

src/lib.rs is the job model and the conversion worker, with no knowledge of a window. src/main.rs is the window. packaging/ holds what turns a build into a package for each platform. DESIGN.md is where every decision and its reasoning live; CLAUDE.md is the short guide for a session working here.

License

MIT, like docling.rs. The models Duckling ships are docling's, under their own licenses, listed in packaging/fetch-models.sh by origin.

About

Convert documents to DocLang, Markdown, JSON or LaTeX with docling.rs, offline

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages