1. Introduction
  2. Guidance
  3. 1. Get started
  4. 2. Bundles
    1. 2.1. All-in-One Library for Browsers
    2. 2.2. All-in-One Library for Node.js
  5. 3. Compilers
    1. 3.1. (Pre-)Compiler in CLI
    2. 3.2. Compiler in Rust
    3. 3.3. Compiler in Node.js
    4. 3.4. Compiler in Wasm (Web)
  6. 4. Renderers
    1. 4.1. Renderer in Rust
    2. 4.2. Renderer in Node.js
    3. 4.3. Renderer in Wasm (Web)
    4. 4.4. Renderer in React
    5. 4.5. Renderer in Solid
    6. 4.6. Renderer in Angular
    7. 4.7. Renderer in Vue3
    8. 4.8. Hexo Plugin
  7. 5. Samples
    1. 5.1. Static, Responsive rendering
    2. 5.2. Streaming, Incremental rendering
    3. 5.3. Serverless rendering
  8. 6. Trouble Shooting
  9. Project samples
  10. 8. shiroa
  11. 9. typst-preview
  12. 10. hexo-renderer-typst
  13. References
  14. 13. Routing to Renferences

reflexo-typst Documentation

#

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:

  • Form1: Renders to SVG at server side and then embeds it as a high-quality vectored image into HTML files statically.

  • Form2: Preprocesses to a Vector Format artifact at server side and renders it at client side (in browser).

  • Form3: Compiles document at client side and manipulates a canvas element at client side.

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

  • A Website built with Typst.ts

  • Instant VSCode Preview Plugin

  • Renderer Plugin for Hexo, a Blog-aware Static Site Generator

  • Renderer/Component Library for JavaScript, React, and Angular

#

Further reading

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