Skip to content

Contributing and Development

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

Contributing and Development

Repository layout

src/                 TypeScript source, templates, filters, CSS, CSL, themes
lib/                 Compiled package output
leafmark-vscode/     VS Code extension
wiki/                GitHub Wiki clone
package.json         Package scripts and dependencies

Local setup

git clone https://github.com/DDDASHXD/leafmark.git
cd leafmark
pnpm install
pnpm typecheck
pnpm build

Useful scripts:

Script Purpose
pnpm typecheck TypeScript validation without emitting files.
pnpm build Compile src/ into lib/.
pnpm leafmark -- ... Run the source CLI through tsx.
pnpm dev -- ... Equivalent source entry point for development.

Testing a change

Use a small project fixture outside committed output or the ignored project/ theme fixture. Exercise only the affected formats and preserve intermediate files when debugging:

pnpm leafmark -- ./project --keep-build-files --html

Before submitting changes:

pnpm typecheck
pnpm build
git diff --check

Do not commit generated document output unless it is an intentional fixture. Keep lib/ synchronized because it is the published CLI entry point.

Theme development

pnpm leafmark -- theme init ./my-theme
cd my-theme
pnpx @skxv/leafmark ./project --html

Theme repositories should keep distributable assets under .leafmark/ and expose .leafmark/theme.json at the repository root. See Themes.

Wiki development

GitHub Wikis are separate Git repositories. This repository keeps a local clone at wiki/. Each .md filename becomes a page; _Sidebar.md and _Footer.md are GitHub Wiki special pages.

Review wiki changes from the nested repository:

git -C wiki status
git -C wiki diff --check

Publishing the wiki is a separate commit and push to leafmark.wiki.git.

Reporting bugs

Open an issue with a minimal project, exact command, tool versions, and full error output. Remove private document content and credentials before attaching config or build files.

Clone this wiki locally