HTML2MARKDOWN(1)
π html2markdown β the girl who turns HTML into markdown π
okay bestie, sit down, because this little icon html2markdown is about to become your new obsession. she's a User Commands girlie, she lives in section 1 of your manual, and she takes a whole page of HTML and just... slays it into markdown. no cap. β¨
β¨ NAME β¨
html2markdown β converts a page of HTML into markdown.
that's it. that's the whole vibe. she takes the HTML, she gives you the markdown. π
π¦ SYNOPSIS π¦
html2markdown [options...] [(filename|url) [encoding]]
so you can hand her options, and optionally a filename or a url, and optionally an encoding. all the brackets are her way of saying "these parts are optional, babe, no pressure". πΈ
π DESCRIPTION π
so here's the tea. html2markdown downloads the HTML page you specified and converts it into text marked up with markdown. main character behaviour, honestly.
the source HTML page can be either:
- a local file, or
- a remote URL.
and if you don't specify anything at all? she just reads from standard input. lowkey generous of her. the output gets printed to standard output, obviously. π
now the encoding situation, because this part actually matters, bestie:
- if an encoding is specified, it will override any encoding info the HTTP Server tries to give you. you're in charge, periodt.
- when an encoding is not specified,
python-feedparserwill be used to determine the source encoding β if it's available. - if it's not available, or if you're reading local files, then the encoding is assumed to be UTF-8.
not me reminding you that python-feedparser is doing the detective work when it can. if it can't, UTF-8 is the fallback. that's the rule. π«Ά
π OPTIONS π
this is the good part. so many little switches to play with. go off. π
--no-wrap-linksβ don't wrap long links. let them breathe, let them be long, it's fine.--ignore-emphasisβ don't include any formatting for emphasis. the drama is gone, unfortunately.--reference-linksβ use reference style links instead of in-line links. very academic of you.--ignore-linksβ don't include any formatting for links. no links, no problems.--protect-linksβ protect links from line breaks surrounding them by wrapping them with angle brackets. safety first, bestie. π‘οΈ--ignore-imagesβ don't include any formatting for images.--images-to-altβ discard the image data and only keep the alt text. minimalism, but make it iconic.--images-with-sizeβ write image tags that have height and width attrs as raw html, so the dimensions stay intact. keeping the receipts, fr fr.-g,--google-docβ convert an html-exported Google Document. yes, that specific thing. she knows.-d,--dash-unordered-listβ use a dash rather than a star for unordered list items. a dash girlie, noted.-e,--asterisk-emphasisβ use an asterisk rather than an underscore for emphasized text. asterisk supremacy, honestly.-b BODY_WIDTH,--body-width=BODY_WIDTHβ number of characters per output line, and0means no wrap at all. zero = unhinged, free, unwrapped. π-i LIST_INDENT,--google-list-indent=LIST_INDENTβ the number of pixels Google indents nested lists. very specific, very Google.-s,--hide-strikethroughβ hide strike-through text. only relevant when-gis specified as well, so don't get confused. π--escape-allβ escape all special characters. the output is less readable, but it avoids corner case formatting issues. trade-off queen.--bypass-tablesβ format tables in HTML rather than Markdown syntax.--ignore-tablesβ ignore table-related tags (table,th,td,tr) while keeping the rows. so the rows stay, the table-ness doesn't.--single-line-breakβ use a single line break after a block element rather than two line breaks.
NOTE: requires --body-width=0. do not skip this. she will not work otherwise.
--unicode-snobβ use unicode throughout the document. as you should. β¨--no-automatic-linksβ do not use automatic links wherever applicable.--no-skip-internal-linksβ do not skip internal links. keep them. all of them.--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].--default-image-alt=TEXTβ the default alt string for images that are missing one. give your mystery images a name, bestie. π--pad-tablesβ pad the cells to equal column width in tables. symmetry. aesthetics. we love it.--decode-errors=DECODE_ERRORSβ what to do in case of decode errors. the acceptable values areignore,strict, andreplace. pick your fighter.--versionβ show the program's version number and exit.-h,--helpβ show a help message and exit. the classic. the icon. the one we all press first. π
π AUTHOR π
this manpage was written for Debian by Stefano Rivera <stefanor@debian.org>.
we love a credited author. thank you Stefano, you ate. π«Ά
β the sign-off β
okay so this was html2markdown, version 2015.6.21, from way back in July 2015 β she's vintage, she's timeless, she's still converting HTML into markdown like the queen she is. π
now go convert something. go be the main character of your own terminal. bye bestie!! πβ¨ππ¦πΈ
π¦ where this page comes from
- debian bookworm: python3-html2text 2020.1.16-2 Β· GPL-3.0-only
- ubuntu jammy: python3-html2text 2020.1.16-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