HTML2MARKDOWN(1)

πŸ“¦ version 2025.4.15, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 for mailto: 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 preserves height, width and alt if 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, 0 for 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 -g is 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, and replace are 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 the sup and sub tags.
  • --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