Search by

typesetterio / typesetter-cli

aaronsaray

Create PDFs from markdown with PHP.

Package info

github.com/TypesetterIO/typesetter-cli

Homepage

Documentation

Type:project

pkg:composer/typesetterio/typesetter-cli

Statistics

Installs: 1 418

Dependents: 0

Suggesters: 0

Stars: 11

Open Issues: 0

1.0.0 2026-10-11 16:24 UTC

This package is auto-updated.

Last update: 2026-10-13 16:29:57 UTC


README

Typesetter

License Packagist GitHub Workflow Status

Pages from the Typesetter demo book

Typesetter

Create ebooks, flyers, one-sheets and more from markdown! This command runs locally using PHP to convert your markdown into a PDF.

Install

This requires PHP 8.4 or above.

This tool is meant to be part of the repository that you have your written content. Because of that, you can install it into the local directory with the following command.

composer require typesetterio/typesetter-cli

Usage

Start a new project in the current directory:

vendor/bin/typesetter init

This writes config.php, a two chapter starter book in content/ and my-theme/theme.html.

Generate the PDF:

vendor/bin/typesetter generate

Option Default
--config config.php The config file.
--output Slug of the title plus .pdf The PDF file to write.

Both paths are relative to the working directory.

Docker

docker run --rm -v "$PWD":/runtime ghcr.io/typesetterio/typesetter-cli generate

The container runs as uid 1000. On Linux, to use a different user: --user "$(id -u):$(id -g)".

To learn more, please check out the documentation. This details configuration, customization, themes and cover generation, observers, listeners and more.

Development

Requires PHP 8.4 or newer, Composer, and hadolint. make act additionally needs Docker and act. On macOS, brew install php composer hadolint act.

Run make to list the available targets.

docker build -t typesetter-cli . builds the Docker image.

Changelog

See CHANGELOG.md.

Credits

This was heavily influenced by the Ibis project but is a complete rewrite.

This package stands on the shoulders of giants like MPDF, some parts of Laravel and also the League Commonmark library.

Aaron Saray is the primary author and maintainer.