html2markdown1
Converts a page of html into markdown.
Usage
html2markdown [options ...]
[{(filename | url)
[encoding]}]
Overview
html2markdown downloads the specified HTML page, and converts it to text marked up with markdown. The source HTML page may be a local file or remote URL. If not specified, it will be read from standard input. The output is printed to standard output.
If an encoding is specified, it will override any encoding information provided by the HTTP Server. When not specified, python-feedparser (if available) will be used to determine the source encoding. If not available, or when reading local files, the encoding is assumed to be UTF-8.
Options
-
--default-image-alt=TEXT -
The default alt string for images with missing ones.
-
--pad-tables -
Pad the cells to equal column width in tables.
-
--no-wrap-links -
Don't wrap long links.
-
--wrap-list-items -
Wrap long list items.
-
--wrap-tables -
Wrap long table rows.
-
--ignore-emphasis -
Don't include any formatting for emphasis.
-
--reference-links -
Use reference style links instead of in-line links.
-
--ignore-links -
Don't include any formatting for links.
-
--ignore-mailto-links -
Don't include any formatting for mailto: links.
-
--protect-links -
Protect links from line breaks surrounding them with angle brackets.
-
--ignore-images -
Don't include any formatting for images.
-
--images-as-html -
Always write image tags as row html; preserves height, width and alt if possible.
-
--images-to-alt -
Discard image data, only keep alt text.
-
--images-with-size -
Write image tags with height and width attrs as raw html to retain dimensions.
-
-g, --google-doc -
Convert an html-exported Google Document.
-
-d, --dash-unordered-list -
Use a dash rather than a star for unordered list items.
-
-e, --asterisk-emphasis -
Use an asterisk rather than an underscore for emphasized text.
-
-b BODY_WIDTH, --body-width=BODY_WIDTH -
Number of characters per output line,
0for no wrap.
-
-i LIST_INDENT, --google-list-indent=LIST_INDENT -
Number of pixels Google indents nested lists.
-
-s, --hide-strikethrough -
Hide strike-through text. Only relevant when
-gis specified as well.
-
--escape-all -
Escape all special characters. Output is less readable, but avoids corner case formatting issues.
-
--bypass-tables -
Format tables in HTML rather than Markdown syntax.
-
--ignore-tables -
Ignore table-related tags (table, th, td, tr) while keeping rows.
-
--single-line-break -
Use a single line break after a block element rather than two line breaks. NOTE: Requires
--body-width=0.
-
--unicode-snob -
Use unicode throughout document.
-
--no-automatic-links -
Do not use automatic links wherever applicable.
-
--no-skip-internal-links -
Do not skip internal links.
-
--links-after-para -
Put links after each paragraph instead of document.
-
--mark-code -
Mark program code blocks with
[code]...[/code].
-
--decode-errors=DECODE_ERRORS -
What to do in case of decode errors.
ignore,strict, andreplaceare acceptable values.
-
--open-quote=CHAR -
The character used to open quotes.
-
--close-quote=CHAR -
The character used to clone quotes.
-
--include-sup-sub -
Include the sup and sub tags.
-
--version -
Show program's version number and exit.
-
-h, --help -
Show a help message and exit.
Releases
3 releases since Debian 5.0 (Lenny); the text changed 2 times.
--asterisk-emphasis since Debian 13 (Trixie);
--body-width since Debian 13 (Trixie);
--bypass-tables since Debian 13 (Trixie);
--close-quote since Debian 13 (Trixie);
--dash-unordered-list since Debian 13 (Trixie);
--decode-errors since Debian 13 (Trixie);
--default-image-alt since Debian 13 (Trixie);
--escape-all since Debian 13 (Trixie);
--google-doc since Debian 13 (Trixie);
--google-list-indent since Debian 13 (Trixie);
--help since Debian 13 (Trixie);
--hide-strikethrough since Debian 13 (Trixie);
--ignore-emphasis since Debian 13 (Trixie);
--ignore-images since Debian 13 (Trixie);
--ignore-links since Debian 13 (Trixie);
--ignore-mailto-links since Debian 13 (Trixie);
--ignore-tables since Debian 13 (Trixie);
--images-as-html since Debian 13 (Trixie);
--images-to-alt since Debian 13 (Trixie);
--images-with-size since Debian 13 (Trixie);
--include-sup-sub since Debian 13 (Trixie);
--links-after-para since Debian 13 (Trixie);
--mark-code since Debian 13 (Trixie);
--no-automatic-links since Debian 13 (Trixie);
--no-skip-internal-links since Debian 13 (Trixie);
--no-wrap-links since Debian 13 (Trixie);
--open-quote since Debian 13 (Trixie);
--pad-tables since Debian 13 (Trixie);
--protect-links since Debian 13 (Trixie);
--reference-links since Debian 13 (Trixie);
--single-line-break since Debian 13 (Trixie);
--unicode-snob since Debian 13 (Trixie);
--version since Debian 13 (Trixie);
--wrap-list-items since Debian 13 (Trixie);
--wrap-tables since Debian 13 (Trixie);
-b since Debian 13 (Trixie);
-d since Debian 13 (Trixie);
-e since Debian 13 (Trixie);
-g since Debian 13 (Trixie);
-h since Debian 13 (Trixie);
-i since Debian 13 (Trixie);
-s since Debian 13 (Trixie).
--custom-header until Debian 5.0 (Lenny);
--encoding until Debian 5.0 (Lenny);
--grabber until Debian 5.0 (Lenny);
--include-after-body until Debian 5.0 (Lenny);
--include-before-body until Debian 5.0 (Lenny);
--include-in-header until Debian 5.0 (Lenny);
--no-wrap until Debian 5.0 (Lenny);
--output until Debian 5.0 (Lenny);
--parse-raw until Debian 5.0 (Lenny);
--sanitize-html until Debian 5.0 (Lenny);
--standalone until Debian 5.0 (Lenny);
--strict until Debian 5.0 (Lenny);
-A until Debian 5.0 (Lenny);
-B until Debian 5.0 (Lenny);
-C until Debian 5.0 (Lenny);
-H until Debian 5.0 (Lenny);
-R until Debian 5.0 (Lenny);
-o until Debian 5.0 (Lenny).