Typstyle is a source code formatter written in Rust for the Typst typesetting and document preparation language. It automatically restructures source code to maintain consistent formatting and improve readability. The formatter is designed to preserve document content and rendered appearance while normalizing code structure. Users can configure indentation, line width, text wrapping, and mathematical expression formatting. It supports formatting individual files, entire directories, and selected line ranges. Integration with Tinymist enables formatting directly within compatible code editors. The project also provides Rust and WebAssembly libraries, browser-based formatting, and integration with automated development workflows.
Features
- Automatic Typst source code formatting with consistent styling conventions
- Configurable indentation, line width, text wrapping, and mathematical formatting
- Selective formatting of individual files, directories, and specific line ranges
- Editor integration through the Tinymist Typst language server
- Formatting verification and difference reporting for automated development workflows
- Rust and WebAssembly libraries for embedding formatting capabilities into applications