CLI Reference
CLI Reference
Section titled “CLI Reference”html-to-markdown
Section titled “html-to-markdown”Convert HTML to Markdown
Arguments
Section titled “Arguments”| Name | Flags | Type | Default | Description |
|---|---|---|---|---|
input |
Option<String> |
Input HTML file (use "-" or omit for stdin) |
Options
Section titled “Options”| Name | Flags | Type | Default | Description |
|---|---|---|---|---|
url |
--url |
Option<String> |
Fetch HTML from a URL (alternative to file/stdin) | |
user_agent |
--user-agent |
Option<String> |
User-Agent header when fetching via –url (default mimics a real browser) | |
output |
-o, --output |
Option<PathBuf> |
Output file (default: stdout) | |
generate_completion |
--generate-completion |
Option<Shell> |
Generate shell completion script | |
generate_man |
--generate-man |
bool |
Generate man page | |
heading_style |
--heading-style |
Option<CliHeadingStyle> |
Heading style | |
list_indent_type |
--list-indent-type |
Option<CliListIndentType> |
List indentation type | |
list_indent_width |
--list-indent-width |
Option<u8> |
Spaces per list indent level | |
bullets |
-b, --bullets |
Option<String> |
Bullet characters for unordered lists | |
strong_em_symbol |
--strong-em-symbol |
Option<char> |
Symbol for bold and italic | |
escape_asterisks |
--escape-asterisks |
bool |
Escape asterisk (*) characters | |
escape_underscores |
--escape-underscores |
bool |
Escape underscore (_) characters | |
escape_misc |
--escape-misc |
bool |
Escape misc Markdown characters | |
escape_ascii |
--escape-ascii |
bool |
Escape all ASCII punctuation | |
sub_symbol |
--sub-symbol |
Option<String> |
Symbol to wrap subscript text | |
sup_symbol |
--sup-symbol |
Option<String> |
Symbol to wrap superscript text | |
newline_style |
--newline-style |
Option<CliNewlineStyle> |
Line break style | |
code_block_style |
--code-block-style |
Option<CliCodeBlockStyle> |
Code block style | |
code_language |
-l, --code-language |
Option<String> |
Default language for code blocks | |
no_autolinks |
--no-autolinks |
bool |
Disable autolink conversion | |
link_style |
--link-style |
Option<CliLinkStyle> |
Link rendering style | |
default_title |
--default-title |
bool |
Add default title to links | |
keep_inline_images_in |
--keep-inline-images-in |
Option<Vec<String>> |
Keep inline images in specific elements | |
br_in_tables |
--br-in-tables |
bool |
Use in table cells |
|
compact_tables |
--compact-tables |
bool |
Emit compact (unpadded) GFM tables | |
highlight_style |
--highlight-style |
Option<CliHighlightStyle> |
Style for <mark> elements |
|
extract_metadata |
--extract-metadata |
bool |
Extract metadata from HTML | |
json |
--json |
bool |
Output full ConversionResult as JSON instead of markdown text |
|
include_structure |
--include-structure |
bool |
Include structured document tree in output | |
extract_inline_images |
--extract-inline-images |
bool |
Extract inline images from data URIs and SVGs | |
show_warnings |
--show-warnings |
bool |
Print processing warnings to stderr | |
no_content |
--no-content |
bool |
Skip text content generation, only extract metadata and structure | |
whitespace_mode |
--whitespace-mode |
Option<CliWhitespaceMode> |
Whitespace handling mode | |
strip_newlines |
--strip-newlines |
bool |
Strip newlines from input | |
wrap |
-w, --wrap |
bool |
Enable text wrapping | |
wrap_width |
--wrap-width |
Option<u16> |
Wrap width in columns | |
convert_as_inline |
--convert-as-inline |
bool |
Treat block elements as inline | |
strip_tags |
--strip-tags |
Option<Vec<String>> |
HTML tags to strip | |
preserve_tags |
--preserve-tags |
Option<Vec<String>> |
HTML tags to preserve verbatim | |
skip_images |
--skip-images |
bool |
Skip image elements | |
max_depth |
--max-depth |
Option<usize> |
Maximum DOM traversal depth | |
preprocess |
-p, --preprocess |
bool |
Enable HTML preprocessing | |
preset |
--preset |
Option<CliPreprocessingPreset> |
Preprocessing aggressiveness preset | |
keep_navigation |
--keep-navigation |
bool |
Keep navigation elements | |
keep_forms |
--keep-forms |
bool |
Keep form elements | |
encoding |
-e, --encoding |
String |
utf-8 |
Input character encoding |
debug |
--debug |
bool |
Enable debug mode | |
output_format |
-f, --output-format |
Option<CliOutputFormat> |
Output format (markdown or djot) |
html-to-markdown mcp
Section titled “html-to-markdown mcp”Run as an MCP (Model Context Protocol) server.
Options
Section titled “Options”| Name | Flags | Type | Default | Description |
|---|---|---|---|---|
transport |
--transport |
String |
stdio |
Transport mode: “stdio” (default) or “http”. |
host |
--host |
String |
127.0.0.1 |
HTTP host (only used with –transport http). |
port |
--port |
u16 |
8001 |
HTTP port (only used with –transport http). |