[workspace]
members = [
    ".",
    "crates/*",
    "examples/remove-emphasis/mdbook-remove-emphasis", "guide/guide-helper",
]

[workspace.lints.clippy]
all = { level = "allow", priority = -2 }
correctness = { level = "warn", priority = -1 }
complexity = { level = "warn", priority = -1 }
exhaustive_enums = "warn"
exhaustive_structs = "warn"
manual_non_exhaustive = "warn"

[workspace.lints.rust]
missing_docs = "warn"
rust_2018_idioms = "warn"
unreachable_pub = "warn"

[workspace.package]
edition = "2024"
license = "MPL-2.0"
repository = "https://github.com/rust-lang/mdBook"
rust-version = "1.88.0" # Keep in sync with installation.md and .github/workflows/main.yml

[workspace.dependencies]
anyhow = "1.0.103"
axum = "0.8.9"
clap = { version = "4.6.1", features = ["cargo", "wrap_help"] }
clap_complete = "4.6.6"
ego-tree = "0.11.0"
elasticlunr-rs = "3.0.2"
font-awesome-as-a-crate = "0.3.1"
futures-util = "0.3.32"
glob = "0.3.3"
handlebars = "6.4.2"
hex = "0.4.3"
html5ever = "0.39.0"
indexmap = "2.14.0"
ignore = "0.4.26"
mdbook-core = { path = "crates/mdbook-core", version = "0.5.4" }
mdbook-driver = { path = "crates/mdbook-driver", version = "0.5.4" }
mdbook-html = { path = "crates/mdbook-html", version = "0.5.4" }
mdbook-markdown = { path = "crates/mdbook-markdown", version = "0.5.4" }
mdbook-preprocessor = { path = "crates/mdbook-preprocessor", version = "0.5.4" }
mdbook-renderer = { path = "crates/mdbook-renderer", version = "0.5.4" }
mdbook-summary = { path = "crates/mdbook-summary", version = "0.5.4" }
memchr = "2.8.2"
notify = "8.2.0"
notify-debouncer-mini = "0.7.0"
opener = "0.8.5"
pathdiff = "0.2.3"
pulldown-cmark = { version = "0.13.4", default-features = false, features = ["html"] } # Do not update, part of the public api.
regex = "1.12.4"
select = "0.6.1"
semver = "1.0.28"
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.150"
sha2 = "0.11.0"
shlex = "2.0.1"
snapbox = "1.2.2"
tempfile = "3.27.0"
tokio = "1.52.3"
toml = "1.1.2"
topological-sort = "0.2.2"
tower-http = "0.7.0"
tracing = "0.1.44"
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
walkdir = "2.5.0"

[package]
name = "mdbook"
version = "0.5.4"
authors = [
    "Mathieu David <mathieudavid@mathieudavid.org>",
    "Michael-F-Bryan <michaelfbryan@gmail.com>",
    "Matt Ickstadt <mattico8@gmail.com>"
]
documentation = "https://rust-lang.github.io/mdBook/index.html"
edition.workspace = true
exclude = ["/guide/*"]
keywords = ["book", "gitbook", "rustbook", "markdown"]
license.workspace = true
readme = "README.md"
repository.workspace = true
description = "Creates a book from markdown files"
rust-version.workspace = true

[dependencies]
anyhow.workspace = true
clap.workspace = true
clap_complete.workspace = true
mdbook-core.workspace = true
mdbook-driver.workspace = true
mdbook-html.workspace = true
opener.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true

# Watch feature
ignore = { workspace = true, optional = true }
notify = { workspace = true, optional = true }
notify-debouncer-mini = { workspace = true, optional = true }
pathdiff = { workspace = true, optional = true }
walkdir = { workspace = true, optional = true }

# Serve feature
axum = { workspace = true, features = ["ws"], optional = true }
futures-util = { workspace = true, optional = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread"], optional = true }
tower-http = { workspace = true, features = ["fs", "trace"], optional = true }

[dev-dependencies]
glob.workspace = true
mdbook-preprocessor.workspace = true
mdbook-renderer.workspace = true
regex.workspace = true
select.workspace = true
semver.workspace = true
serde_json.workspace = true
snapbox = { workspace = true, features = ["diff", "dir", "term-svg", "regex", "json"] }
tempfile.workspace = true
walkdir.workspace = true

[features]
default = ["watch", "serve", "search"]
watch = ["dep:notify", "dep:notify-debouncer-mini", "dep:ignore", "dep:pathdiff", "dep:walkdir"]
serve = ["dep:futures-util", "dep:tokio", "dep:axum", "dep:tower-http"]
search = ["mdbook-html/search"]

[[bin]]
doc = false
name = "mdbook"

[[example]]
name = "nop-preprocessor"
test = true

[[example]]
name = "remove-emphasis"
path = "examples/remove-emphasis/test.rs"
crate-type = ["lib"]
test = true

[[test]]
harness = false
test = false
name = "gui"
path = "tests/gui/runner.rs"
crate-type = ["bin"]

[lints]
workspace = true
