Skip to content

Commit

Permalink
Merge pull request #515 from nicoburns/make-bon-optional
Browse files Browse the repository at this point in the history
Make bon builders optional
  • Loading branch information
charlottia authored Dec 18, 2024
2 parents 7c6b947 + 57a1fa9 commit 17db3c3
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 51 deletions.
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

0 comments on commit 17db3c3

Please sign in to comment.