Skip to main content

Crate mdka

Crate mdka 

Source
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§

ConvertResult
Result of a file conversion: the input path and the output path.

Enums§

MdkaError

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 to out_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.