A website used to convert Typst input into syntax-highlighted ANSI output for pasting in Discord messages.
It uses Tree-sitter for syntax highlighting and a vendored copy of uben0's tree-sitter-typst grammar with some modifications.
The vendored grammar is still under the original MIT license, while the rest of the code is under the 0BSD license.
You'll need Rust, LLVM and the wasm-bindgen CLI tool.
Clone the repository.
git clone https://github.com/noClaps/typst2ansi.git
cd typst2ansiRun the build script for your system
make build-mac # assumes LLVM was installed with `brew install llvm`
make build-linuxThe web/ directory will then have all of the required files for the site to work.
AI was used to help with debugging some issues I was having with the Tree-sitter queries and the CI workflow, and to write the build scripts in the Makefile. Aside from that and the vendored grammar, all of the code was written by me.