Skip to content

Installation

Sebastian Skov Nielsen edited this page Aug 1, 2026 · 1 revision

Installation

Leafmark itself is distributed through npm and can be invoked with pnpx or npx. PDF generation uses external document tools.

Requirements

Tool Required for Notes
Node.js 20+ All commands Runs the Leafmark CLI.
Pandoc All exports Converts Markdown into the target format.
XeLaTeX or pdfLaTeX PDF XeLaTeX is preferred and supports system fonts.
pdfunite Optional cover merge Supplied by Poppler.
Git GitHub themes Used to clone theme repositories.
Chromium-family browser HTML blocks in PDF/DOCX Chrome, Chromium, Edge, or Brave. JavaScript remains disabled.

macOS

Install Node.js from nodejs.org or your preferred version manager, then:

brew install pandoc basictex poppler

After installing BasicTeX, a new terminal may be required before xelatex is available.

Windows

winget install OpenJS.NodeJS.LTS
winget install JohnMacFarlane.Pandoc MiKTeX.MiKTeX oschwartz10612.Poppler

Restart the terminal after installation so updated PATH entries take effect.

Debian and Ubuntu

sudo apt-get update
sudo apt-get install nodejs npm pandoc texlive-xetex poppler-utils git

Fedora

sudo dnf install nodejs npm pandoc texlive-xetex poppler-utils git

Arch Linux

sudo pacman -S nodejs npm pandoc texlive-bin poppler git

Run Leafmark

No global installation is necessary:

pnpx @skxv/leafmark --help

To pin a project to a known version:

pnpm add -D @skxv/leafmark
pnpm leafmark

Equivalent npm usage is possible with npx @skxv/leafmark.

Diagnostics

pnpx @skxv/leafmark doctor

Leafmark also performs a first-run check. In an interactive terminal it can offer to install missing tools. Use --yes to accept the supported automatic installation plan, or --skip-tools-check to suppress the first-run prompt.

Note

doctor reports the core toolchain. A Chromium-family browser is additionally required only when converting HTML blocks to images for PDF or DOCX.

Clone this wiki locally