[package]
name                   = "ndg-commonmark"
description            = "Flavored CommonMark processor for Nix-related projects, with support for CommonMark, GFM, and Nixpkgs extensions."
authors.workspace      = true
version                = "2.7.2"                                                                                                             # should not track workspace
edition.workspace      = true
rust-version.workspace = true
readme                 = true
license.workspace      = true
repository.workspace   = true
categories.workspace   = true
keywords.workspace     = true

[package.metadata.docs.rs]
cargo-args = [ "-Zunstable-options", "-Zrustdoc-scrape-examples" ]

[lib]
name = "ndg_commonmark"
path = "src/lib.rs"

[features]
default      = [ "ndg-flavored", "syntastica" ]
gfm          = [  ]
ndg-flavored = [ "gfm", "nixpkgs", "wiki" ]
nixpkgs      = [  ]
wiki         = [  ]

# Feature flags for Syntax highlighting.
# Syntastica requires the "most" feature flag if we need Nix support, and Syntect
# relies on two-face (another crate that powers the Bat pager) for Nix syntax
# highlighting. The default is Syntastica because of the more robust theme support
# but Syntect *might* be chosen by end-users if theming is less important, and if
# compile times are unmanageable.
syntastica = [
  "dep:syntastica",
  "dep:syntastica-core",
  "dep:syntastica-parsers",
  "dep:syntastica-themes",
  "dep:syntastica-query-preprocessor",
]
syntect = [ "dep:syntect", "dep:two-face" ]

[dependencies]
comrak.workspace              = true
html-escape.workspace         = true
kuchikikiki.workspace         = true
log.workspace                 = true
markup5ever.workspace         = true
regex.workspace               = true
serde.workspace               = true
serde_json.workspace          = true
syntastica                    = { version = "0.6.1", optional = true }
syntastica-core               = { version = "0.6.1", optional = true }
syntastica-parsers            = { version = "0.6.1", features = [ "most" ], optional = true }
syntastica-query-preprocessor = { version = "0.6.1", optional = true }
syntastica-themes             = { version = "0.6.1", optional = true }
syntect                       = { version = "5.3.0", optional = true }
tendril.workspace             = true
thiserror.workspace           = true
two-face                      = { version = "0.5.1", optional = true, features = [ "syntect-default-onig" ] }
walkdir.workspace             = true

[dev-dependencies]
tempfile.workspace = true

[lints]
workspace = true
