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

See Development for setup and validation, Architecture for implementation ownership, and the test index for focused suites. Contributor rules are in AGENTS.md.

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

The full test suite also uses uv, Python, Ruff, Quarto, Node, and R with stringi, jsonlite, knitr, and yaml12 installed. Run the Rust tests with Python dependencies available, followed by the formatting check and lints:

uv run --no-project --with ruff --with py-yaml12 -- 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

CI runs these checks on macOS and Windows. On Windows, put Rscript.exe and Quarto on PATH and set $env:PYTHONUTF8 = "1" in PowerShell before running the tests. Unix shell-script tests run on macOS; symlink tests need Windows Developer Mode or symlink privileges. Git attributes keep source and transcript files at LF while byte-sensitive fixtures retain their original line endings.

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.5.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.5.0
File Size Uploaded Provenance Actions
yamark-0.5.0.tar.gz 664.0 kB With provenance Details for yamark-0.5.0.tar.gz

Built distributions (wheels)

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

Total release size: 9.7 MB

Release files / yamark-0.5.0.tar.gz

Download URL yamark-0.5.0.tar.gz
Size 664.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fd8f5286b69eb316501f7a4e10d5c877427fd7a8d55e51323716a9ab88a3e2fc
BLAKE2b-256 checksum
How to use checksums
648e76158f4582aec01454216b3a94a2bf58e023247a52f20b56f0b159867037
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 4, 2026.

Transparency log

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

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

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 Nov 4, 2026.

Transparency log

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

Download URL yamark-0.5.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
a981e59aee91944e049b311342957b7a729afca6c625b0ec9b0f7b99633b401e
BLAKE2b-256 checksum
How to use checksums
2cb01df14c77238ef1335edfaaf49eb01f301f1edbead94f088a697e3b09f24d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 4, 2026.

Transparency log

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

Download URL yamark-0.5.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
1bbc73f8f735a3d4cfd6c72a10f9f15d09ed045af55acfda670d6ef416645c12
BLAKE2b-256 checksum
How to use checksums
b2799a2ac7b74174d812903a658ff0fb4fb1b9daf80732a39873e94bacbb8d4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 4, 2026.

Transparency log

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

Download URL yamark-0.5.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
eef2f9e4cd6a72fb706c82a05623d0491f929f62c0bacc94b05b06e4d63c1ba1
BLAKE2b-256 checksum
How to use checksums
00f336674d6f84e5a50a011b011380425a99555425dc2d15fdf2ef980ffdb286
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 4, 2026.

Transparency log

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

Download URL yamark-0.5.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
7c5324d0edba336189d6851f2070092c1e44fd1879a8d351aac26d01d265b4d3
BLAKE2b-256 checksum
How to use checksums
ecff07a776db9bf6b5d822c8ad81206079ac5ef3dab52ca7c13a2466b5c33cd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 4, 2026.

Transparency log

Security for yamark 0.5.0

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for yamark-0.5.0.tar.gz

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 Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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