Skip to main content

Yamark

Yamark is a fast formatter for YAML and Markdown. It formats whole files and embedded content, keeping source readable and changes easy to review. Regions without a supported rewrite stay unchanged.

For supported embedded code, Yamark can also call Ruff, Air, Prettier, or another configured formatter.

See the documentation for examples, configuration, editor integrations, and the full syntax reference.

Install

With uv installed, run Yamark directly from PyPI without a separate install:

uvx yamark format config.yaml docs/

This formats the selected files in place. To install a persistent yamark command:

uv tool install yamark

Usage

The examples below use an installed yamark command. To keep running from PyPI without installing it, replace yamark with uvx yamark.

Format one or more files or directories in place:

yamark format config.yaml docs/

Format the current directory:

yamark format

Check whether files are already formatted without writing changes:

yamark format --check docs/

Show a unified diff without writing changes:

yamark format --diff docs/

Format stdin for editor and CI integrations:

yamark format --stdin-file-path config.yaml < config.yaml

Convert JSON-family input from stdin to formatted YAML on stdout:

yamark to-yaml --stdin-file-path data.json5 < data.json5

The path is not read or written. Its suffix selects the exact JSON dialect. This is a conversion, not source formatting.

Directory traversal skips hidden paths and respects .gitignore, .ignore, and global Git ignore files by default. Pass a hidden path explicitly to format it.

While formatting is enabled, standalone {{< ... >}} and {{% ... %}} shortcode tokens are preserved, including multiline tokens and quoted arguments. Directive-looking text inside a recognized token is data. Yamark does not match shortcode names or interpret their bodies: Markdown between tokens formats normally. An unterminated token or quote preserves the rest of the enclosing Markdown document or fragment. This does not guarantee rendering equivalence for arbitrary Hugo or Jinja templates.

To disable body formatting, surround the region with <!-- fmt: off --> and <!-- fmt: on -->. While formatting is disabled, directives follow the existing linewise policy: a recognized fmt: on line resumes formatting even if the surrounding text resembles a shortcode argument, code fence, HTML, or math block.

Explicitly skipped Markdown retains its bytes, including trailing spaces and line endings: <!-- fmt: skip --> preserves the next selected node, <!-- fmt: off --> preserves the disabled region, and <!-- fmt: skip file --> preserves the enclosing Markdown document or fragment. This protection survives supported nesting in Markdown fences and divs; surrounding Markdown still formats.

Editor integrations

The VS Code and Positron formatter extension lives in editors/vscode/. See the editor guide for installation and configuration.

Development

Building from source requires Rust 1.98.1 or newer.

Build or install the binary from a checkout:

cargo build --bin yamark
cargo install --path .

Build a Python wheel for local testing:

uvx maturin build --release

Run the Rust tests, formatting check, and lints:

cargo test
cargo fmt --check
cargo clippy --all-targets --all-features -- -D warnings

Run the external CLI and VS Code extension tests separately:

uv run external-tests/run.py
cd editors/vscode
npm test

When tests/yaml-test-suite/data exists, cargo test also runs the YAML Test Suite round-trip test. Populate that directory with:

tools/bootstrap-yaml-test-suite-data.py --source ~/github/posit-dev/r-yaml12/tests/testthat/yaml-test-suite

Use the pages linked from website/reference.qmd and the public CLI tests as behavior references.

Release

See the release guide for the stable-version bump, checks, release notes, tag, publication verification, and post-release +dev bump.

Metadata

Release files for yamark 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yamark 0.4.0
File Size Uploaded
yamark-0.4.0.tar.gz 585.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for yamark 0.4.0
File
yamark-0.4.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
yamark-0.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
yamark-0.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
yamark-0.4.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
yamark-0.4.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 9.5 MB

Release files / yamark-0.4.0.tar.gz

Download URL yamark-0.4.0.tar.gz
Size 585.1 kB
Tags Source
SHA-256 checksum
How to use checksums
aa11d79049bfcb8c53f33f46d4bc0820de36263fe1e90e1ac6c2903ad0916d65
BLAKE2b-256 checksum
How to use checksums
7ceb14baf8c35b944dcf099949a3505472a06b710c6f411cb79e1ff39f8c4266
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release files / yamark-0.4.0-py3-none-win_amd64.whl

Download URL yamark-0.4.0-py3-none-win_amd64.whl
Size 1.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
d0057decef2657507510c7893aa7fbceb60ce602a289b682ee19cd5bf890b55e
BLAKE2b-256 checksum
How to use checksums
fa41e23fb2ed0deeb82c7acc1d69425b0042cebf344e1933ee58ce7f24ca63a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release files / yamark-0.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL yamark-0.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.9 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
72026a7ebff96c417eccf905d4422863310e981a1a8b196f4404057883c24a3f
BLAKE2b-256 checksum
How to use checksums
122ea28c03bde6a33f1d3722a20e99e24774ee6e3044fbf3c802a4445fe43176
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release files / yamark-0.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL yamark-0.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.7 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
ce1f74fc2780a87d3d0044757589ca2046bfeaa9de425a26ce5a856e39d75819
BLAKE2b-256 checksum
How to use checksums
e12da046ec45c23ccaa67742f0b59396240dc392f8ac19565eb3c5dfa0931563
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release files / yamark-0.4.0-py3-none-macosx_11_0_arm64.whl

Download URL yamark-0.4.0-py3-none-macosx_11_0_arm64.whl
Size 1.7 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f828da0c2b8efa37eb984eec919d8a0dfc011f32c9a9a616091803c98de525cb
BLAKE2b-256 checksum
How to use checksums
dbfea572f947c603866ae909f52479c00fd35ad1f5667b73c826be00bbea815c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release files / yamark-0.4.0-py3-none-macosx_10_12_x86_64.whl

Download URL yamark-0.4.0-py3-none-macosx_10_12_x86_64.whl
Size 1.8 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8036315453c8bc2df5784485704def28806e7135b967625f3b723121673c4eeb
BLAKE2b-256 checksum
How to use checksums
beb6964e044992d4dfffe1b8c819f44310ff8328f7bdcc38d3f806d8d9f701e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

6 release files

0.3.0

5 release files

0.2.1

5 release files

0.2.0

5 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page