[package]
name = "kitpdf"
version = "0.3.3"
edition = "2024"
rust-version = "1.86"
description = "A terminal-based PDF viewer using the Kitty graphics protocol"
license = "MIT"
repository = "https://github.com/wensheng/kitpdf"
readme = "README.md"
keywords = ["cli", "utility", "pdf", "epub"]
categories = ["command-line-utilities"]

[[bin]]
name = "kitpdf"
path = "src/main.rs"

[dependencies]
# MuPDF document/rendering support.
# EPUB depends on MuPDF's HTML engine, so both `html` and `epub` must be enabled.
mupdf = { version = "0.6.0", default-features = false, features = ["svg", "system-fonts", "img", "html", "epub"] }

# Kitty graphics protocol
kittage = { version = "0.4.0", features = ["crossterm-tokio", "image-crate", "log"] }

# Terminal I/O
crossterm = { version = "0.29.0", features = ["event-stream"] }

# Image processing (raw RGB buffers plus rayon pixel ops in the image pipeline)
image = { version = "0.25", features = ["png", "rayon"], default-features = false }

# Async runtime
tokio = { version = "1", features = ["rt-multi-thread", "macros", "signal", "io-util"] }

# Async utilities (StreamExt for flume receiver stream)
futures-util = { version = "0.3", default-features = false }

# Channels (works with both sync and async contexts)
flume = { version = "0.12", default-features = false, features = ["async"] }

# Pixel-level parallelism in the image pipeline (par_enumerate_pixels_mut for search highlights)
rayon = { version = "1", default-features = false }

# Unix signal handling (SIGSTOP/Ctrl-Z)
nix = { version = "0.31", features = ["signal"] }

# Shared memory for faster Kitty image transfer
memmap2 = "0"

# Parse color config values (tint color)
csscolorparser = { version = "0.8", default-features = false }

# Logging
log = "0.4"
flexi_logger = "0.31"

# Error handling
anyhow = "1"
thiserror = "2"

# State cache serialization
serde = { version = "1", features = ["derive"] }
serde_json = "1"

# XDG base directories
directories = "6"

# MD5 hashing for cache file naming
md-5 = "0.11"

# Performance allocator (mimalloc is faster for many small allocs)
mimalloc = "0.1"
lazy_static = "1.5.0"

[profile.production]
inherits = "release"
lto = "fat"
