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§
- Convert
Result - Result of a file conversion: the input path and the output path.
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 in parallel with rayon, writing them to
out_dir(default mode). - html_
files_ to_ markdown_ with - Converts multiple HTML files in parallel with the given
ConversionOptions, writing them toout_dir. - html_
to_ markdown - Converts an HTML string to a Markdown string (default mode:
balanced). - html_
to_ markdown_ with - Converts an HTML string to Markdown with the given
ConversionOptions.