Repository navigation
Bundles and Chapter Ordering
Leafmark treats ordinary root-level .md files as chapters. It excludes:
_frontmatter.md_merged.md- dotfiles
- files outside the active project root
If order is absent, filenames with numeric prefixes sort first by number:
01-introduction.md
02-method.md
10-conclusion.md
appendix.md
Other names follow in natural, case-insensitive filename order.
.leafmark/config.json can store:
{
"order": ["introduction.md", "method.md", "conclusion.md"]
}Files named in the list are emitted first. Entries that no longer exist are ignored. Discovered files missing from the list are appended in natural order.
Run the organizer:
pnpx @skxv/leafmark order ./reportControls:
- ↑/↓ selects a row
- Space grabs/releases it
- ↑/↓ moves a grabbed row
- Enter saves
-
qor Ctrl+C cancels
Aliases: o, organize, and organise.
Chapter arguments bypass discovery and saved order:
pnpx @skxv/leafmark ./report introduction.md appendix.mdOnly the requested existing Markdown files are built, in argument order. Duplicate names are ignored.
A bundle is a direct subfolder of a project that contains its own project marker:
.leafmark/config.jsonleafmark.json_frontmatter.md
Example:
portfolio/
├── .leafmark/config.json
├── overview.md
├── client-a/
│ ├── .leafmark/config.json
│ ├── proposal.md
│ └── estimate.md
└── client-b/
├── _frontmatter.md
└── report.md
Build a bundle by placing its name after the project folder:
pnpx @skxv/leafmark ./portfolio client-aBuild selected chapters inside it:
pnpx @skxv/leafmark ./portfolio client-a proposal.mdBundle output is nested under the root output directory:
dist/client-a/client-a.pdf
The bundle uses its own config, metadata, chapter discovery, styles, citations, and path base. The parent project and package resources remain available through Pandoc's resource path.
Leafmark documentation · Source repository · npm
Leafmark Wiki
Authoring
Configuration
Building
Help