Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

API Reference

mdka exposes a small, focused public API. The table below shows the complete surface — every function and type you need, nothing you don’t.

Functions

FunctionLanguageDescription
html_to_markdownRustConvert HTML string → Markdown (default mode)
html_to_markdown_withRustConvert with explicit ConversionOptions
html_file_to_markdownRustConvert one file; output alongside input or to out_dir
html_file_to_markdown_withRustSingle file with options
html_files_to_markdownRustParallel bulk conversion (rayon)
html_files_to_markdown_withRustBulk with options

Types

TypeDescription
ConversionModeEnum: Balanced · Strict · Minimal · Semantic · Preserve
ConversionOptionsControls pre-processing per-call; built via for_mode()
ConvertResultReturned by single-file functions: src + dest paths
MdkaErrorThe only error type: wraps std::io::Error

Guarantees

  • html_to_markdown and html_to_markdown_with never panic. They accept any &str, including empty strings, binary garbage, or deeply nested HTML.
  • File functions propagate IO errors via Result<_, MdkaError>.
  • Output is always valid UTF-8.
  • Output always ends with a single newline when the input produces any content.