HTML2MARKDOWN(1)
π html2markdown β the manual page, but make it cute π
okay so bestie, gather round, because we're about to talk about html2markdown, a User Commands legend. it lives in section 1 of the manual (iykyk), and it's literally here to take a whole HTML page and turn it into markdown. no cap. π¦
β¨ NAME β¨
html2markdown β converts a page of HTML into markdown. that's it. that's the whole job. iconic behavior honestly. π
πΈ SYNOPSIS πΈ
html2markdown [options...] [(filename|url) [encoding]]
like... that's the whole vibe. options, then maybe a filename or a url, then maybe an encoding. slay.
π DESCRIPTION π
html2markdown downloads the HTML page you asked for and converts it into text marked up with markdown. the source HTML page can be a local file or a remote URL β no judgement either way, both are valid. π«Ά
if you don't specify a source at all? it just reads from standard input. and the output always gets printed to standard output. main character energy, never in the way.
now here's the tea about encodings β β if you specify an encoding, it overrides any encoding info the HTTP Server tried to hand you. rude but necessary. when you don't specify one, python-feedparser (if it's available) gets to figure out the source encoding for you. and if it's not available, or if you're reading local files, the encoding is assumed to be UTF-8. periodt.
π OPTIONS π
so many flags. so many little switches. let's go one by one because we're thorough like that. π
--default-image-alt=TEXTβ the default alt string to use for images that are missing one. a little backup bestie for your alt text.--pad-tablesβ pads the cells so every column is the same width in tables. alignment queen. π--no-wrap-linksβ don't wrap long links. let them stretch, they've earned it.--wrap-list-itemsβ wrap long list items. do wrap those ones, actually.--wrap-tablesβ wrap long table rows.--ignore-emphasisβ don't include any formatting for emphasis. no italics, no bold, just plain.--reference-linksβ use reference style links instead of in-line links.--ignore-linksβ don't include any formatting for links. bye links π--ignore-mailto-linksβ don't include any formatting formailto:links specifically.--protect-linksβ protect links from line breaks around them by wrapping them in angle brackets.--ignore-imagesβ don't include any formatting for images.--images-as-htmlβ always write image tags as raw html; this preservesheight,widthandaltif possible.--images-to-altβ discard the image data entirely, only keep the alt text. minimalism β¨--images-with-sizeβ write image tags that have height and width attrs as raw html, so the dimensions are retained.-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 it 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. don't skip this one bestie, it literally will not work otherwise.
--unicode-snobβ use unicode throughout document. fancy fr fr π--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 at the end of the 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 the acceptable values.--open-quote=CHARβ the character used to open quotes.--close-quote=CHARβ the character used to clone quotes.--include-sup-subβ include thesupandsubtags.--versionβ show program's version number and exit.-h,--helpβ show a help message and exit.
π§ AUTHOR π§
this manpage was written for Debian, by Stefano Rivera <stefanor@debian.org>. thank you Stefano, you ate π
and that's the whole thing!! html2markdown 2015.6.21 π dating all the way back to July 2015 β a true vintage icon, still serving looks. go convert something pretty bestie, you got this ππ¦β¨
π¦ where this page comes from
- debian trixie: python3-html2text 2025.4.15-1 Β· GPL-3.0-only
- ubuntu noble: python3-html2text 2024.2.26-1 Β· GPL-3.0-only
- ubuntu resolute: python3-html2text 2025.4.15-1 Β· GPL-3.0-only
- ubuntu stonking: python3-html2text 2025.4.15-1 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms