Skip to content
/ d2typ Public

πŸ” Convert structured data (CSV/JSON/YAML/TOML/XLSX) into Typst syntax for embedding in documents.

Notifications You must be signed in to change notification settings

Acture/d2typ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

38 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

d2typ

crates.io homebrew CI Typst Compatible License: AGPL v3

Convert structured data (CSV, JSON, YAML, etc.) into static Typst declarations.

d2typ is a command-line tool that transforms external data files into .typ files, making your Typst documents self-contained, portable, and reproducible. Ideal for certificate generation, static reporting, or when working in constrained rendering environments.


✨ Features

  • Converts common formats to Typst syntax
  • Supported input: CSV, JSON, YAML, TOML, Excel (.xlsx)
  • Output: valid Typst #let declarations
  • Format auto-detection via file extension
  • CLI-oriented: stdin/stdout support
  • Excel sheet selection, CSV header toggle
  • Works with Typst web/cloud by avoiding read() and csv()

πŸ“¦ Installation

cargo install d2typ

Via Homebrew (custom tap)

brew tap acture/tools
brew install d2typ

From source

git clone https://github.com/acture/d2typ.git
cd d2typ
cargo install --path .

πŸš€ Usage

# Convert CSV
d2typ input.csv > data.typ

# Convert JSON
d2typ input.json -o data.typ

# Read from stdin
cat input.yaml | d2typ

# Force input format & output file
d2typ data.xlsx --sheet Sheet1 --format xlsx -o out.typ

CLI Options

Usage: d2typ [OPTIONS] [INPUT]

Arguments:
  [INPUT]  Input file (omit for stdin)

Options:
  -o, --output <OUTPUT>      Output file (omit for stdout)
  -f, --format <FORMAT>      Force input format [default: auto]
                             [values: auto, csv, json, yaml, toml, xlsx]
      --no-header            CSV: treat first row as data
      --sheet <SHEET>        XLSX: select sheet
  -h, --help                 Print help
  -V, --version              Print version

About

πŸ” Convert structured data (CSV/JSON/YAML/TOML/XLSX) into Typst syntax for embedding in documents.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages