-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
This guide creates a multi-chapter PDF project using the package directly from npm. You do not need to install Leafmark globally.
Leafmark needs Node.js 20+, Pandoc, and a LaTeX engine for PDF output. Follow Installation, then verify the machine:
pnpx @skxv/leafmark doctorEvery required line should say ok. HTML-only and DOCX workflows do not require LaTeX.
pnpx @skxv/leafmark init ./my-report
cd my-reportLeafmark creates:
my-report/
├── .leafmark/
│ └── config.json
├── introduction.md
└── sources.bib
Edit .leafmark/config.json, or create _frontmatter.md:
---
title: My First Report
subtitle: A Leafmark example
author:
- Your Name
date: 2026-08-01
toc: true
number-sections: true
---If both locations define a metadata key, _frontmatter.md wins.
Edit introduction.md:
# Introduction
Leafmark combines ordinary Markdown files into one document.
## Purpose
This report demonstrates the basic workflow.Add findings.md:
# Findings
The document can contain tables, images, links, citations, and code.Run the interactive organizer:
pnpx @skxv/leafmark orderUse ↑/↓ to select, Space to grab or release a chapter, Enter to save, and q to cancel. The resulting order is stored in .leafmark/config.json.
pnpx @skxv/leafmarkThe output is dist/my-report.pdf. Other common builds are:
pnpx @skxv/leafmark --html
pnpx @skxv/leafmark --html-only
pnpx @skxv/leafmark --output-format docx
pnpx @skxv/leafmark watchpnpx @skxv/leafmark theme list
pnpx @skxv/leafmark theme use classic
pnpx @skxv/leafmarkThe theme is copied into .leafmark/theme/, so the installed result is local and inspectable. See Themes.
- Learn the complete Project Structure.
- Add sources with Markdown and Citations.
- Review every setting in Configuration and Frontmatter Reference.
- Add designed components with HTML and CSS.
Leafmark documentation · Source repository · npm
Leafmark Wiki
Authoring
Configuration
Building
Help