Typstyle Docs

Developer Guide

This guide covers environment setup, building, testing, and documentation for typstyle.

Prerequisites

Initial Setup

Clone and build the project:

git clone https://github.com/typstyle-rs/typstyle.git
cd typstyle
cargo build              # Debug build
cargo build --release    # Release build
git clone https://github.com/typstyle-rs/typstyle.git
cd typstyle
cargo build              # Debug build
cargo build --release    # Release build

Install required tools:

# For testing
cargo binstall cargo-nextest cargo-insta
# For building wasm
cargo binstall wasm-pack
# For documentation
cargo binstall shiroa
# For testing
cargo binstall cargo-nextest cargo-insta
# For building wasm
cargo binstall wasm-pack
# For documentation
cargo binstall shiroa

Workspace Layout

  • crates/typstyle/crates/typstyle/ — formatter CLI
  • crates/typstyle-core/crates/typstyle-core/ — core formatting logic
  • crates/typstyle-consistency/crates/typstyle-consistency/ — consistency test framework
  • crates/typstyle-typlugin/crates/typstyle-typlugin/ — typst plugin for embedded usage
  • crates/typstyle-wasm/crates/typstyle-wasm/ — wasm bindings
  • tests/tests/ — integration tests and fixtures
  • docs/docs/ — documentation source (based on shiroa and written in typst)
  • contrib/typstyle-embedded/contrib/typstyle-embedded/ — typstyle as typst package
  • playground/playground/ — web-based interactive playground