1. Introduction
  2. User Guide
  3. 1. Installation
  4. 2. Quick Start
  5. 3. Changelog
  6. Usage
  7. 4. Command Line Interface
  8. 5. Editor Integration
  9. Features
  10. 6. Formatting Features
    1. 6.1. Markup
    2. 6.2. Code
    3. 6.3. Math Equations
    4. 6.4. Tables
  11. 7. Escape Hatch
  12. 8. Limitations
  13. Advanced
  14. 9. How It Works
  15. 10. Developer Guide
    1. 10.1. Core
    2. 10.2. Documentation
    3. 10.3. Playground

typstyle

#

Developer Guide

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

#

Prerequisites

  • Rust stable toolchain with cargo
  • Node.js and yarn (for web assets)
  • cargo-nextest and cargo-insta (for testing)
  • shiroa (for documentation)

#

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

Install required tools:

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

#

Workspace Layout

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