rspress-plugin-typst

Use Typst .typ files as Rspress documentation pages.

Typst's experimental HTML export is compiled through @myriaddreamin/typst-ts-node-compiler, then rendered inside the Rspress theme.

Experimental

Typst HTML export is still experimental. Behavior may change; do not rely on it for production-critical publishing yet.

Features

  • Conventional routing: docs/guide/hello.typ → /guide/hello
  • Document title / description from #set document(...)
  • Optional frontmatter via #metadata(...) <frontmatter>
  • Searchable plain-text content extracted from the HTML body
  • Heading ids for outline anchors

Quick start

pnpm add rspress-plugin-typst
// rspress.config.ts
import { defineConfig } from '@rspress/core';
import { pluginTypst } from 'rspress-plugin-typst';

export default defineConfig({
  root: 'docs',
  plugins: [pluginTypst()],
});

Then add Typst pages next to Markdown:

docs/
  index.mdx
  guide/
    hello.typ

Live examples

These pages are authored as .typ files in this docs site: