Introduction

Typst.ts is a project dedicated to bring the power of typst to the world of JavaScript. In short, it composes ways to compile and render your Typst document typically inside Browser Environment. In the scope of server-side rendering collaborated by server and browser, there would be a data flow like this:

Browser-side module needed: : compiler; : renderer.

Specifically, it first presents a typst document in three typical forms:

The Form2: Vector Format is developed specially for typst documents, and it has several fancy features:

Figure: Features of the Vector Format.

So with Form2, you can continue rendering the document in different ways:

Static but responsive rendering

Example Application: single-file, shiroa and hexo-renderer-typst

A compressed artifact containing data for different theme and screen settings. The bundle size of artifacts is optimized for typst documents.

Read more.

Incremental server-side rendering

Example Application: typst-preview

Build a server for compilation with a rust library, streaming the artifact, and render it incrementally.

Read more.

Serverless client-side rendering

Example Application: single-file

Run the entire typst directly in browser, like typst.app.

Read more.

Application

Further reading

  1. Get started with Typst.ts
  2. Trouble shooting