Migrating to Typsite 0.1.6

In version 0.1.6, Typsite introduced a series of major updates, inevitably including some breaking-changes. This document aims to help users migrate to the new version smoothly.

1 Typsite Packages

Parts of the Typst library that are closely related to Typsite have been extracted into separate Typst packages. You can find them under typsite/packages. Typsite bundles these packages into the binary and automatically installs them to the @local @local directory during each typsite compile typsite compile .

To facilitate debugging and using packages, Typsite also supports local package auto-installation. Just specify the --packages --packages flag when running typsite compile typsite compile .

  • In watch-mode watch-mode , Typsite will also automatically update these local packages and recompile the site.

So now, the Typsite Typst libraries are split into two parts:

  • @local/typsite:0.1.0 @local/typsite:0.1.0 : Contains core functionality of Typsite, provides basic functions, and acts as an interface between Typsite and site libraries.

    • Thanks to this layer, it is unlikely for future updates to introduce more breaking-changes.
  • root/lib/ root/lib/ : The site library of each Typsite site. Users are free to customize anything here.
2 Migration

If you’re relying on site libraries from before version 0.1.6, you’ll need to make the following replacements when migrating:

  • import "lib.typ" import "lib.typ" |-> import "/lib/lib.typ" import "/lib/lib.typ"
  • html-text html-text |-> html.text html.text
  • text-align text-align |-> html.align html.align

    • (Make sure not- to replace text-align text-align inside /lib/site.typ /lib/site.typ )

It’s recommended to import lib.typ lib.typ using an absolute path. If you’re using tinymist as your LSP, you’ll need to specify the Typst root-path root-path for better experience:

  • In VSCode, you can add the following to .vscode/settings.json .vscode/settings.json in your site directory:

    "tinymist.rootPath": "absolute path of your site/root"
    "tinymist.rootPath": "absolute path of your site/root"

For any breaking-changes not anticipated here, you can easily detect them by launching watch-mode watch-mode with typsite compile --port 8000 typsite compile --port 8000 . Typsite will provide helpful error messages whenever you modify a file, allowing you to fix issues quickly.

3 Other Updates
  • Added support for converting Typst math to MathML.

    • This improves the rendering of math formulas, and the MathML conversion will detect Typst math fonts in-place for compatibility.
  • inline inline function has a new fit-font fit-font parameter, which can adapt to Typst’s context text.size context text.size .
  • For pages containing backlinks and references, duplicate tags in the <head> <head> section are now removed, resulting in a much cleaner structure.
  • In the default site library, show-rules show-rules have been modularized. You can easily add/remove/modify show-rule show-rule items in /lib/lib.typ /lib/lib.typ .
  • In the default site configuration, link titles have been optimized. You can now preview links as Link Title [Link URL] Link Title [Link URL] .