[package]
name = "panache"
version = "2.27.0"
edition = "2024"
readme = "README.md"
description = "An LSP, formatter, and linter for Pandoc markdown, Quarto, and RMarkdown"
license = "MIT"
repository = "https://github.com/jolars/panache"
homepage = "https://jolars.github.io/panache"
keywords = ["quarto", "pandoc", "markdown", "formatter", "language-server"]
categories = [
    "command-line-utilities",
    "text-processing",
    "parsing",
    "parser-implementations",
]
authors = ["Johan Larsson <johan@jolars.co>"]

[workspace]
members = [
    "crates/panache-wasm",
]

[lib]
doctest = false

[[bin]]
name = "panache"
path = "src/main.rs"
required-features = ["cli"]

[dependencies]
annotate-snippets = "0.12.7"
clap = { version = "4.6.0", features = ["derive"], optional = true }
dirs = "6.0.0"
env_logger = "0.11.8"
emojis = "0.8.0"
globset = "0.4"
ignore = { version = "0.4", optional = true }
log = { version = "0.4.28", features = ["release_max_level_info"] }
regex = "1.12.2"
rowan = "0.16.1"
salsa = "0.26.0"
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0"
yaml_parser = "0.3.0"
pretty_yaml = "0.6.0"
similar = { version = "2.6.0", features = ["text"] }
tempfile = "3.26"
tokio = { version = "1", features = [
    "process",
    "rt-multi-thread",
    "io-util",
    "io-std",
    "time",
    "macros",
    "fs",
], optional = true }
toml = "1.0.7"
tower-lsp-server = { version = "0.23", optional = true }
unicode-width = "0.2"
uuid = { version = "1.22.0", features = ["v4"], optional = true }

[dev-dependencies]
similar-asserts = "1.7.0"
insta = "1.43.2"
tokio = { version = "1", features = ["macros", "rt"] }
assert_cmd = "2.0"
predicates = "3.0"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
rayon = "1.10.0"
which = "8.0"

[features]
default = ["cli", "lsp"]
cli = ["dep:clap", "dep:ignore"]
lsp = ["dep:tokio", "dep:tower-lsp-server", "dep:uuid"]

[build-dependencies]
clap = { version = "4.6.0", features = ["derive"] }
clap_complete = "4.6.0"
clap_mangen = "0.2.33"
clap-markdown = "0.1.5"

[package.metadata.deb]
maintainer = "Johan Larsson <johan@jolars.co>"
copyright = "2026, Johan Larsson <johan@jolars.co>"
license-file = ["LICENSE", "4"]
extended-description = """\
A CLI formatter for Quarto, Pandoc, and Markdown files. Supports Quarto-specific \
syntax like fenced divs, tables, and math formatting that other formatters struggle \
with. Provides intelligent line wrapping, consistent formatting, and an integrated \
language server for editor support."""
depends = "$auto"
section = "text"
priority = "optional"
assets = [
    [
        "target/release/panache",
        "usr/bin/",
        "755",
    ],
    [
        "README.md",
        "usr/share/doc/panache/",
        "644",
    ],
    [
        "LICENSE",
        "usr/share/doc/panache/",
        "644",
    ],
    [
        "target/man/*.1",
        "usr/share/man/man1/",
        "644",
    ],
    [
        "target/completions/panache.bash",
        "usr/share/bash-completion/completions/panache",
        "644",
    ],
    [
        "target/completions/panache.fish",
        "usr/share/fish/vendor_completions.d/panache.fish",
        "644",
    ],
    [
        "target/completions/_panache",
        "usr/share/zsh/vendor-completions/_panache",
        "644",
    ],
]

[package.metadata.generate-rpm]
assets = [
    { source = "target/release/panache", dest = "/usr/bin/panache", mode = "755" },
    { source = "README.md", dest = "/usr/share/doc/panache/README.md", mode = "644", doc = true },
    { source = "LICENSE", dest = "/usr/share/doc/panache/LICENSE", mode = "644", doc = true },
    { source = "target/man/*.1", dest = "/usr/share/man/man1/", mode = "644" },
    { source = "target/completions/panache.bash", dest = "/usr/share/bash-completion/completions/panache", mode = "644" },
    { source = "target/completions/panache.fish", dest = "/usr/share/fish/vendor_completions.d/panache.fish", mode = "644" },
    { source = "target/completions/_panache", dest = "/usr/share/zsh/vendor-completions/_panache", mode = "644" },
]

[[bench]]
name = "formatting"
harness = false

[[bench]]
name = "lsp_incremental"
harness = false
