Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make bon builders optional #515

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,18 @@ shell-words = { version = "1.0", optional = true }
slug = "0.1.4"
emojis = { version = "0.6.2", optional = true }
arbitrary = { version = "1", optional = true, features = ["derive"] }
bon = "3"
bon = { version = "3", optional = true }
caseless = "0.2.1"

[dev-dependencies]
ntest = "0.9"
toml = "0.7.3"

[features]
default = ["cli", "syntect"]
default = ["cli", "syntect", "bon"]
cli = ["clap", "shell-words", "xdg"]
shortcodes = ["emojis"]
bon = ["dep:bon"]

[target.'cfg(all(not(windows), not(target_arch="wasm32")))'.dependencies]
xdg = { version = "^2.5", optional = true }
Expand All @@ -80,3 +81,7 @@ clap = { version = "4.0", optional = true, features = [
[[example]]
name = "syntect"
required-features = [ "syntect" ]

[[example]]
name = "s-expr"
required-features = [ "bon" ]
12 changes: 8 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,19 @@ pub use html::Anchorizer;
#[allow(deprecated)]
pub use parser::parse_document_with_broken_link_callback;
pub use parser::{
parse_document, BrokenLinkCallback, BrokenLinkReference, ExtensionOptions,
ExtensionOptionsBuilder, ListStyleType, Options, ParseOptions, ParseOptionsBuilder, Plugins,
PluginsBuilder, RenderOptions, RenderOptionsBuilder, RenderPlugins, RenderPluginsBuilder,
ResolvedReference, URLRewriter,
parse_document, BrokenLinkCallback, BrokenLinkReference, ExtensionOptions, ListStyleType,
Options, ParseOptions, Plugins, RenderOptions, RenderPlugins, ResolvedReference, URLRewriter,
};
pub use typed_arena::Arena;
pub use xml::format_document as format_xml;
pub use xml::format_document_with_plugins as format_xml_with_plugins;

#[cfg(feature = "bon")]
pub use parser::{
ExtensionOptionsBuilder, ParseOptionsBuilder, PluginsBuilder, RenderOptionsBuilder,
RenderPluginsBuilder,
};

/// Legacy naming of [`ExtensionOptions`]
pub type ComrakExtensionOptions<'c> = ExtensionOptions<'c>;
/// Legacy naming of [`Options`]
Expand Down
Loading
Loading