0.0
The project is in a healthy, maintained state
Parse and render ChordPro files to text, HTML, and PDF. Native bindings via UniFFI for high performance.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 1.15
 Project Readme

ChordSketch

A Rust implementation of the ChordPro file format parser and renderer. 100% ChordPro compatible. Supports parsing ChordPro files into a structured AST and rendering to plain text, HTML, and PDF.

Features

  • Full ChordPro format parser with zero external dependencies in the core crate
  • Three output formats: plain text, HTML, and PDF
  • Chord transposition
  • Configuration file system (chordsketch.json)
  • Inline markup (bold, italic, etc.)
  • Chord diagrams and extended {define} directives
  • Section environments (verse, chorus, tab, grid, custom)
  • Delegate environments (ABC, Lilypond, SVG, textblock)
  • Conditional directive selectors (instrument, user)
  • Multi-song files ({new_song})
  • Font, size, and color directives
  • Image directive
  • Multi-page PDF with page control

Try it Online

ChordSketch Playground — try ChordPro rendering directly in your browser, no installation required.

Installation

npm (WASM)

npm install @chordsketch/wasm

See the @chordsketch/wasm README for usage with JavaScript/TypeScript.

Homebrew (macOS / Linux)

brew tap koedame/tap
brew install chordsketch

Scoop (Windows)

scoop bucket add koedame https://github.com/koedame/scoop-bucket
scoop install chordsketch

winget (Windows)

winget install koedame.chordsketch

Docker

docker run --rm ghcr.io/koedame/chordsketch --version
docker run --rm -v "$PWD:/data" ghcr.io/koedame/chordsketch /data/song.cho

From crates.io

cargo install chordsketch

From source

Requires Rust 1.85 or later.

git clone https://github.com/koedame/chordsketch.git
cd chordsketch
cargo install --path crates/cli

Usage

# Render to plain text (default)
chordsketch song.cho

# Render to HTML
chordsketch -f html song.cho -o song.html

# Render to PDF
chordsketch -f pdf song.cho -o song.pdf

# Transpose up 2 semitones
chordsketch --transpose 2 song.cho

# Use a custom config file
chordsketch -c myconfig.json song.cho

# Process multiple files
chordsketch -f pdf song1.cho song2.cho -o songbook.pdf

Library Usage

The core parser and renderers are available as separate library crates:

use chordsketch_core::parser::parse;
use chordsketch_render_text::render_song;

let input = "{title: Amazing Grace}\n{subtitle: Traditional}\n\n[G]Amazing [G7]grace, how [C]sweet the [G]sound";
let song = parse(input).unwrap();
let text = render_song(&song);
println!("{text}");

Workspace Structure

Crate Description
chordsketch-core Parser, AST, and transforms (zero external dependencies)
chordsketch-render-text Plain text renderer
chordsketch-render-html HTML renderer
chordsketch-render-pdf PDF renderer
chordsketch Command-line tool
chordsketch-wasm WebAssembly bindings via wasm-bindgen

Packages

Package Path Description
@chordsketch/wasm packages/npm npm package with TypeScript types
Playground packages/playground Browser-based ChordPro editor and renderer

Links

License

SDK crates (core, renderers, CLI): MIT

Future application layer (Forum, Playground, Desktop): AGPL-3.0-only