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.6.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.6.0
File Size Uploaded Provenance Actions
yamark-0.6.0.tar.gz 696.5 kB With provenance Details for yamark-0.6.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for yamark 0.6.0
File Actions
yamark-0.6.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for yamark-0.6.0-py3-none-win_amd64.whl
yamark-0.6.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.6.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
yamark-0.6.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for yamark-0.6.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
yamark-0.6.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for yamark-0.6.0-py3-none-macosx_11_0_arm64.whl
yamark-0.6.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for yamark-0.6.0-py3-none-macosx_10_12_x86_64.whl

Total release size: 9.8 MB

Release files / yamark-0.6.0.tar.gz

Download URL yamark-0.6.0.tar.gz
Size 696.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fe6354d7443cf83cd5e98e6e0192369057f5908ecc426bdce3a2e8423637aec9
BLAKE2b-256 checksum
How to use checksums
83bd66b1be3dc9c335c678ba57e2f23b0943d260adc9271815374cdd4b3cce64
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 10, 2026.

Transparency log

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

Download URL yamark-0.6.0-py3-none-win_amd64.whl
Size 1.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
8832d5d200fef25c573bf671ca47c605a500f7bee876f7b4a17055dcbcfffc5f
BLAKE2b-256 checksum
How to use checksums
67f7bf4d31e6f4f4dfb12d95092276d2f1f9f3828a013fd212aa177c98030069
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 10, 2026.

Transparency log

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

Download URL yamark-0.6.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
ff49d37ba029a3555cd4245b432608d92eea1ac9e2275df1decada9feac94bb1
BLAKE2b-256 checksum
How to use checksums
8d6ed187b15f072eb47b03be5142ef58e89f6af723f111f2b192c4b149004262
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 10, 2026.

Transparency log

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

Download URL yamark-0.6.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.8 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
3b92770d1ca27c6f9467531b9b0d0e3e1748d4e289d9d20126e0fcaa411ddd99
BLAKE2b-256 checksum
How to use checksums
f8e90007a65e2595ac50a5f635efcd22227a833c4bbd62fc0d447a8ba7375f7d
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 10, 2026.

Transparency log

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

Download URL yamark-0.6.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
ed44f097c73b1e7842eef57d5c94b84ca1de8d26bc9c6b0090cad832bd5b279d
BLAKE2b-256 checksum
How to use checksums
970dec1587711069354bea3d860a564a08b373ecc85f9a027779a44fd0620390
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 10, 2026.

Transparency log

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

Download URL yamark-0.6.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
b9c01f20555d46055071061fe5d150fdd7c6c06948c9f55c77a7de72f162c493
BLAKE2b-256 checksum
How to use checksums
1d88b55f9bc63b0b978f4c1fd2ec0c027be8fc69b9b2daf16dee10d2365a096a
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 10, 2026.

Transparency log

Security for yamark 0.6.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.6.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 10, 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