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

Usage — CLI

The mdka command-line tool is provided by the mdka-cli crate.

Quick Reference

mdka [OPTIONS] [FILE...]

Run mdka --help to see the full option list with descriptions.

Common Patterns

Convert from stdin:

echo '<h1>Hello</h1>' | mdka
curl https://example.com | mdka

Convert a single file (output goes to the same directory):

mdka page.html          # → page.md

Convert to a specific directory:

mdka -o out/ page.html  # → out/page.md

Bulk conversion (-o is required for multiple files):

mdka -o out/ docs/*.html

Choose a conversion mode:

mdka --mode minimal --drop-shell page.html   # extract body text
mdka --mode preserve -o archive/ *.html      # maximum fidelity

All Options

This table mirrors mdka --help. If the two ever disagree, --help is the truth — it is generated from the binary you are running.

FlagDescription
-o, --output <DIR>Output directory (defaults to the input’s directory)
-m, --mode <MODE>Conversion mode: balanced (default) · strict · minimal · semantic · preserve
--preserve-idsKeep id attributes
--preserve-classesDeprecated, no effect. Markdown has no attribute syntax
--preserve-dataDeprecated, no effect. Same reason
--preserve-ariaDeprecated, no effect. Same reason
--drop-shellDrop nav, header, footer, aside
--unwrap-wrappersUnwrap div, span, section, article, main that carry no meaning
-h, --helpShow this help
-V, --versionShow the version
--End of options; everything after is a path

An unrecognised --prefixed argument is rejected rather than treated as a filename. If you genuinely have a file whose name begins with -, put -- before it: mdka -- -weird.html.

The three deprecated flags are still accepted, so existing command lines keep working, but they change nothing about the output. They are documented here only so that you can recognise them; do not reach for them expecting an effect. See ConversionOptions.

For full mode descriptions see Conversion Modes.