Typst Preview: a macOS Quick Look extension for .typ files

Hi everyone,I built a small macOS tool called Typst Preview that lets me preview .typ files directly in Finder using Quick Look.

Why I made it

I wanted a more native macOS workflow for quickly checking Typst documents without opening an editor first, and Quick Look felt like the most natural place for that.

How it works

The project has two parts:

  1. a Quick Look extension that tries to compile the selected .typ file
  2. a host app that handles package downloads and shared cache management

If a document depends on packages that are not installed yet, the extension requests them, the host app downloads them, and Quick Look can render the document after retrying.

Current limitations

There are still some important limitations:

  • Documents that import external assets such as images will fail to compile, because maybe the macOS Quick Look sandbox does not currently allow the extension to access everything a normal Typst workflow can access.
  • Math mode is not working correctly yet. I am still investigating and fixing this part.
  • The first preview of a package-heavy document may require one extra retry after dependencies are downloaded.

Current state

Despite those limitations, the tool is already usable for my local workflow and can handle package-based documents in many cases.

Source code

GitHub: GitHub - WangHaoZhengMing/typst_preview: A macOS Quick Look extension for Typst files, integrating the Rust compiler via C bindings for high-performance previewing. · GitHub

If you use macOS and work with Typst regularly, I’d be very interested in feedback, especially on the Quick Look workflow and the package-handling behavior.


4 Likes