Expand description
HTML to Markdown converter - Lightweight and optimized library.
Usage as CLI tool is in mdka-cli.
Full documentation: https://nabbisen.github.io/mdka-rs/
§Quick start
use mdka::{html_to_markdown, html_to_markdown_with};
use mdka::options::{ConversionMode, ConversionOptions};
// default mode (balanced)
let md = html_to_markdown("<h1>Hello</h1>");
assert!(md.contains("# Hello"));
// convert by specifying the mode
let opts = ConversionOptions::for_mode(ConversionMode::Minimal);
let md = html_to_markdown_with("<h1>Hello</h1>", &opts);
assert!(md.contains("# Hello"));Re-exports§
pub use options::ConversionMode;pub use options::ConversionOptions;
Modules§
- options
- Conversion options and mode definitions
Structs§
- File
Outcome - What happened to one file in a bulk conversion.
Enums§
Functions§
- html_
file_ to_ markdown - Converts a single HTML file to Markdown (default mode:
balanced). - html_
file_ to_ markdown_ with - Converts a single HTML file to Markdown with the given
ConversionOptions. - html_
files_ to_ markdown - Converts multiple HTML files, writing them to
out_dir(default mode). Parallel across CPU cores when theparallelfeature is on (the default); sequential otherwise – this function exists either way (RFC 039 §2.4, §3 A4): opting out of parallelism changes only how the work is done, never which functions are available. - html_
files_ to_ markdown_ with - Converts multiple HTML files with the given
ConversionOptions, writing them toout_dir. Parallel when theparallelfeature is on; sequential otherwise – seehtml_files_to_markdown. - html_
to_ markdown - Converts an HTML string to a Markdown string (default mode:
balanced). - html_
to_ markdown_ many - Converts multiple HTML strings to Markdown (default mode:
balanced), each independently. - html_
to_ markdown_ many_ with - Converts multiple HTML strings to Markdown with the given
ConversionOptions, each independently. It cannot fail, so it returns plain strings, not a result type (RFC 039 §3 A2). Parallel across CPU cores when theparallelfeature is on (the default); sequential otherwise – this function exists either way, only how it runs changes (RFC 039 §2.4, §3 A2). - html_
to_ markdown_ with - Converts an HTML string to Markdown with the given
ConversionOptions. - version
- The crate’s version, as declared in
Cargo.toml. Node and Python have long had their own; Rust callers had to reach forCARGO_PKG_VERSIONthemselves (RFC 039 §2.5, §3 A5).