HTML2MARKDOWN(1)

πŸ“¦ version 2020.1.16, in debian bookworm, ubuntu jammy

πŸ’– 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-feedparser will 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, and 0 means 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 -g is 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 are ignore, strict, and replace. 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