Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
panache
A formatter, linter, and LSP for Quarto (.qmd), Pandoc, and Markdown files.
Work in Progress
This project is in early development. Expect bugs, missing features, and breaking changes.
Installation
From crates.io (Recommended)
Pre-built Binaries
Download pre-built binaries from the releases page. Available for:
- Linux (x86_64, ARM64)
- macOS (Intel, Apple Silicon)
- Windows (x86_64)
Each archive includes the binary, man pages, and shell completions.
Linux Packages
For Debian/Ubuntu systems:
# Download the .deb from releases
For Fedora/RHEL/openSUSE systems:
# Download the .rpm from releases
Packages include:
- Binary at
/usr/bin/panache - Man pages for all subcommands
- Shell completions (bash, fish, zsh)
Usage
Formatting
# Format a file in place
# Check if a file is formatted
# Format from stdin
|
# Format all .qmd files in directory
Linting
# Lint a file
# Lint entire working directory
Language Server (LSP)
panache includes a built-in Language Server Protocol implementation for editor integration.
Start the server:
Editor Configuration:
The LSP communicates over stdin/stdout and provides document formatting capabilities.
-- Add to your LSP config
local lspconfig = require
local configs = require
-- Define panache LSP
if not configs.
-- Enable it
lspconfig..
Format on save:
vim..
Install a generic LSP client extension like vscode-languageserver-node, then configure in settings.json:
Or use the Custom LSP extension.
Add to ~/.config/helix/languages.toml:
[[]]
= "markdown"
= ["panache-lsp"]
= true
[]
= "panache"
= ["lsp"]
Configuration: The LSP automatically discovers .panache.toml from your workspace root.
Configuration
panache looks for a configuration in:
.panache.tomlorpanache.tomlin current directory or parent directories~/.config/panache/config.toml
Example config
# Markdown flavor and line width
= "quarto"
= 80
= "auto"
= "reflow"
# External code formatters (opt-in)
# Enable R formatting with preset
[]
= "air" # Quick setup
# Or use full custom configuration
[]
= "black"
= ["-", "--line-length=88"]
# Add formatters for other languages
[]
= "rustfmt"
# External code linters (opt-in)
[]
= "jarl" # Enable R linting
See .panache.toml.example for a complete configuration reference.
External Code Formatters
panache supports external formatters for code blocks—opt-in and easy to enable:
# Enable R formatting with preset
[]
= "air" # Available: "air", "styler"
# Enable Python formatting with preset
[]
= "ruff" # Available: "ruff", "black"
Key features:
- Opt-in by design - No surprises, explicit configuration
- Preset shortcuts - Quick setup with sensible defaults
- Parallel execution - Formatters run concurrently with markdown formatting
- Graceful fallback - Missing tools preserve original code (no errors)
- Custom config - Full control with
cmd,args,stdinfields
Full custom configuration:
# Custom Python formatter
[]
= "black"
= ["-", "--line-length=88"]
= true
# Add formatters for other languages
[]
= "rustfmt"
Additional details:
- Formatters respect their own config files (
.prettierrc,pyproject.toml, etc.) - Support both stdin/stdout and file-based formatters
- 30 second timeout per formatter invocation
External Code Linters
panache supports external linters for code blocks—opt-in via configuration:
# Enable R linting
[]
= "jarl" # R linter with JSON output
Key features:
- Opt-in by design - Only runs if configured
- Stateful code analysis - Concatenates all code blocks of same language to handle cross-block dependencies
- LSP integration - Diagnostics appear inline in your editor
- CLI support -
panache lintshows external linter issues - Line-accurate diagnostics - Reports exact line/column locations
How it works:
- Collects all code blocks of each configured language
- Concatenates blocks with blank-line preservation (keeps original line numbers)
- Runs external linter on concatenated code
- Maps diagnostics back to original document positions
Supported linters:
- jarl - R linter with structured JSON output
Note: Auto-fixes from external linters are currently disabled due to byte offset mapping complexity. Diagnostics work perfectly.
Motivation
I wanted a formatter that understands Quarto and Pandoc syntax. I have tried to use Prettier as well as mdformat, but both fail to handle some of the particular syntax used in Quarto documents, such as fenced divs and some of the table syntax.
Design Goals
- Full LSP implementation for editor integration
- Linting as part of LSP but also available as a standalone CLI command
- Support Quarto, Pandoc, and Markdown syntax
- Fast lossless parsing and formatting (no AST changes if already formatted)
- Be configurable, but have sane defaults (that most people can agree on)
- Format math
- Hook into external formatters for code blocks (e.g.
airfor R,rufffor Python)