[package]
name = "docspec"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme = "README.md"
description = "Streaming document conversion: convenience facade re-exporting readers, writers, and event types"
keywords = ["document", "conversion", "streaming"]
categories = ["parsing", "encoding"]

[features]
# Default features: markdown reader, blocknote writer, and pandoc native writer.
default = ["markdown", "blocknote", "pandoc-native"]

# Format readers (event sources).
markdown = ["dep:docspec-markdown-reader"]
html = ["dep:docspec-html-reader"]
docx = ["dep:docspec-docx-reader"]

# Format writers (event sinks).
blocknote-writer = ["dep:docspec-blocknote-writer"]
oxa-writer = ["dep:docspec-oxa-writer"]
html-writer = ["dep:docspec-html-writer"]
pandoc-native-writer = ["dep:docspec-pandoc-native-writer"]

# Lower-level primitives for implementing custom writers.
json = ["dep:docspec-json"]

# Convenience meta-features.
# `blocknote`/`oxa`/`pandoc-native` currently enable only the writer; once their readers exist
# the meta will expand to enable both directions.
blocknote = ["blocknote-writer"]
oxa = ["oxa-writer"]
pandoc-native = ["pandoc-native-writer"]
all-readers = ["markdown", "html", "docx"]
all-writers = ["blocknote-writer", "oxa-writer", "html-writer", "pandoc-native-writer"]
all-libs = ["json"]
full = ["all-readers", "all-writers", "all-libs"]

[dependencies]
docspec-core = { workspace = true }
docspec-json = { workspace = true, optional = true }
docspec-markdown-reader = { workspace = true, optional = true }
docspec-blocknote-writer = { workspace = true, optional = true }
docspec-html-reader = { workspace = true, optional = true }
docspec-docx-reader = { workspace = true, optional = true }
docspec-oxa-writer = { workspace = true, optional = true }
docspec-html-writer = { workspace = true, optional = true }
docspec-pandoc-native-writer = { workspace = true, optional = true }

[dev-dependencies]
serde_json = "1"
tempfile = "3"
zip = { version = "8", default-features = false, features = ["deflate"] }

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints]
workspace = true
