[workspace]
members = [ "mdfrier" , "what-terminal-font"]

[package]
name = "mdfried"
version = "0.21.0"
edition = "2024"
authors = ["Benjamin Große <ste3ls@gmail.com>"]
description = "A markdown viewer for the terminal that renders images and big headers"
repository = "https://github.com/benjajaja/mdfried"
homepage = "https://github.com/benjajaja/mdfried"
readme = "README.md"
license = "GPL-3.0-or-later"
exclude = ["assets/*", "!assets/docs"]
rust-version = "1.86.0"

[features]
default = ["chafa-dyn", "svg", "mermaid"]
chafa-dyn = ["ratatui-image/chafa-dyn"] # for distribution
chafa-static = ["ratatui-image/chafa-static"] # for building a static binary with musl
svg = ["resvg"]
mermaid = ["svg", "dep:mermaid-rs-renderer"]

[dependencies]
ansi-to-tui = "8.0.1"
arborium = { version = "2.17.0", features = ["all-languages"] }
bitflags = "2.10.0"
color-eyre = "0.6.5"
clap = { version = "4.5.21", features = ["cargo", "derive"] }
confy = "0.6.1"
cosmic-text = "0.18.2"
crossterm = { version = "0.29", features = ["use-dev-tty"] }
flexi_logger = { version = "0.31.7", features = ["buffer_writer"] }
ghrepo = "0.7.1"
image = "0.25.2"
itertools = "0.14.0"
libc = { version = "0.2", default-features = false }
log = { version = "0.4.28" }
mdfrier = { version = "3.0.3", path = "mdfrier", features = ["ratatui"] }
what-terminal-font = { version = "0.1.1", path = "what-terminal-font" }
notify = "8.1.0"
notify-debouncer-mini = "0.6.0"
open = "5.3.3"
ratatui = { version = "^0.30.0", features = ["serde", "crossterm_0_29"] }
ratatui-image = { version = "11.0.3", default-features = false, features = ["serde"] }
regex = "1.11.1"
mermaid-rs-renderer = { version = "0.2.2", optional = true }
resvg = { version = "0.47.0", optional = true }
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "blocking"] }
unicode-width = "0.2.2"
serde = { version = "^1.0", features = ["derive"] }
textwrap = "0.16.2"
tokio = { version = "1.32.0", features = ["full"] }
url = "2.5.8"

[dev-dependencies]
pretty_assertions = "1.4"
insta = "1.44.3"
criterion = "0.5.1"
ctor = "0.2"

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

[[bin]]
name = "mdfried"
bench = false

[package.metadata.release]
sign-commit = true
sign-tag = true

[profile.release]
codegen-units = 1
lto = true
opt-level = 3

[workspace.metadata.release]
pre-release-replacements = [
  {file="assets/docs/CHANGELOG.md", search="## \\[Unreleased\\]", replace="## [Unreleased]\n\n## [{{version}}] - {{date}}", exactly=1},
]

[lints.rust]
explicit_outlives_requirements = "warn"
macro_use_extern_crate = "warn"
missing_abi = "warn"
noop_method_call = "warn"
single_use_lifetimes = "warn"
unit_bindings = "warn"
unsafe_op_in_unsafe_fn = "warn"
unused_extern_crates = "warn"
unused_import_braces = "warn"
unused_lifetimes = "warn"
unused_macro_rules = "warn"
unused_qualifications = "warn"

[lints.clippy]
# pedantic = { level = "warn", priority = -1 }
allow_attributes = "warn"
# as_conversions = "warn"
as_pointer_underscore = "warn"
assertions_on_result_states = "warn"
cfg_not_test = "warn"
dbg_macro = "warn"
default_union_representation = "warn"
deref_by_slicing = "warn"
empty_drop = "warn"
empty_enum_variants_with_brackets = "warn"
empty_structs_with_brackets = "warn"
error_impl_error = "warn"
exit = "warn"
filetype_is_file = "warn"
float_cmp_const = "warn"
format_push_string = "warn"
get_unwrap = "warn"
if_then_some_else_none = "warn"
impl_trait_in_params = "warn"
implicit_clone = "warn"
infinite_loop = "warn"
let_underscore_untyped = "warn"
lossy_float_literal = "warn"
map_err_ignore = "warn"
mem_forget = "warn"
missing_assert_message = "warn"
mod_module_files = "warn"
multiple_inherent_impl = "warn"
mutex_atomic = "warn"
negative_feature_names = "warn"
non_zero_suggestions = "warn"
pathbuf_init_then_push = "warn"
pub_without_shorthand = "warn"
rc_buffer = "warn"
rc_mutex = "warn"
redundant_feature_names = "warn"
redundant_test_prefix = "warn"
redundant_type_annotations = "warn"
ref_patterns = "warn"
rest_pat_in_fully_bound_structs = "warn"
same_name_method = "warn"
semicolon_inside_block = "warn"
str_to_string = "warn"
string_add = "warn"
string_lit_chars_any = "warn"
string_slice = "warn"
suspicious_xor_used_as_pow = "warn"
tests_outside_test_module = "warn"
try_err = "warn"
undocumented_unsafe_blocks = "warn"
unnecessary_safety_comment = "warn"
unnecessary_safety_doc = "warn"
unnecessary_self_imports = "warn"
unneeded_field_pattern = "warn"
unseparated_literal_suffix = "warn"
unused_result_ok = "warn"
unused_trait_names = "warn"
unwrap_used = "warn"
verbose_file_reads = "warn"
wildcard_dependencies = "warn"
