html2textrc(5)

πŸ“¦
version 2.4.0 Β· 3 versions
, in alpine 3.24, nixos 26.05, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’– html2textrc(5) β€” the File Formats Manual one, bestie πŸ’–

okay so this is the manual page for html2textrc, the formatting properties file that html2text(1) reads. it's giving "glow-up instruction sheet" and honestly? iconic. let's get into it πŸŽ€


✨ NAME ✨

html2textrc β€” the formatting properties file for html2text(1). that's it, that's the name, no cap.


🌸 SYNOPSIS 🌸

Key [ = | : ] Value

like... that's the whole shape of it. key, maybe an equals or a colon, value. slay.


πŸ¦‹ DESCRIPTION πŸ¦‹

so the html2textrc(5) file defines a set of formatting properties used by the html2text(1) utility, and those properties override the program's built-in formatting defaults. every single line in the html2textrc(5) file is either a formatting property or a comment. that's it. no in-between. periodt.

lines with a leading "#" or "!" β€” meaning the first non-space character is a "#" or a "!" β€” plus blank lines (a line that's only whitespace characters, like, nothing but vibes) are considered comments and ignored. everything else gets literary interpreted by the parser as a formatting property. and a string-type property value may also be empty, which unsets the default value. both the property key and the property value may contain C-style escape sequences to mask meta characters. cute, right? πŸ’…

a property definition line consists of:

  1. optional leading space,
  2. the property key β€” a sequence of non-space characters except "=" and ":" β€” as described below,
  3. an optional space,
  4. an optional "=" or ":",
  5. optional space,
  6. the property value as described below.

everything up to the next newline is interpreted literary as the value of the specified element. literary meant leading white-space must be quoted with backslashes (i.e. "\ "). and bestie, be aware not to include unwanted trailing white-space characters. those sneaky little things. πŸ™ˆ


πŸ‘‘ OPTIONS πŸ‘‘

the following is the list of valid formatting properties, together with their default values. if the -style command line option of html2text(1) is used, different default values apply. just so you know. πŸ’œ

curly braces indicate alternatives, e.g. {A B}C stands for AC or BC.

  • DOCUMENT.{vspace.{before after} indent.{left right}} β€” default 0. specifies how many blank lines are inserted before and after, and how many blank columns are inserted to the left and to the right of the formatted document. (Numeric.)
  • BODY.{vspace.{before after} indent.{left right}} β€” default 0. same for the document body. (since the document body is currently the only document part that is rendered, it is virtually the same whether you specify DOCUMENT or BODY). (Numeric.)
  • {OL UL DIR MENU DL}.vspace.{before between after} β€” default 0. specifies how many blank lines are inserted before a list, between the individual list items, and after the list. (Numeric.)
  • {OL UL DIR MENU}.indents β€” default 6. specifies by how deep list items are indented. if an item bullet would not fit into the space created by the indentation, then the indentation is automatically increased such that the bullet fits in (relevant for relatively wide bullets, e.g. roman numbers). if N blank-separated integers are specified instead of one, then the first N-1 integers specify indentation for the first N-1 list nesting levels, while the last integer specifies the indentation for nesting levels N and higher. (Numeric.)
  • {UL DIR}.default_types β€” default DISC CIRCLE SQUARE. specifies the default list type (i.e. the bullet style), if the HTML list tag does not specify an explicit type. legal values are NO_BULLET, DISC, SQUARE, CIRCLE, CUSTOM1, CUSTOM2 and CUSTOM3. if more than one value is specified, then the values apply for the respective list nesting levels (see indents). (Option.)
  • MENU.default_types β€” default NO_BULLET. same for <MENU>, but here the default is NO_BULLET. (Option.)
  • LI.{disc square circle custom1 custom2 custom3}_bullet β€” default {* # o + - ~}. specifies the strings used as list item bullets. (String.)
  • {DT DD}.{vspace.{before after} indent.{left right}} β€” default 0. specifies how many blank lines are inserted before and after, and how many blank columns are inserted to the left and to the right of each <DT> or <DD> element. (Numeric.)
  • HR.marker β€” default =. specifies the character to use for horizontal rules. (String.)
  • HR.{vspace.{before after} indent.{left right}} β€” default 0. specifies how many blank lines are inserted before and after, and how many blank columns are inserted to the left and to the right of the horizontal rule. (Numeric.)
  • {H1 H2 H3 H4 H5 H6}.prefix β€” default {****** ***** **** *** ** *}. specifies how headings are decorated with a prefix. (the default values have a trailing blank, e.g. "****** ".) (String.)
  • {H1 H2 H3 H4 H5 H6}.suffix β€” default {****** ***** **** *** ** *}. specifies how headings are decorated with a suffix. (the default values have a leading blank, e.g. "\ ******".) (String.)
  • {H1 H2 H3 H4 H5 H6}.vspace.{before after} β€” default 0. specifies how many blank lines are inserted before and after headings. (Numeric.)
  • {PRE P}.{vspace.{before after} indent.{left right}} β€” default 0. specifies how many blank lines are inserted before and after, and how many blank columns are inserted to the left and to the right of these items. (Numeric.)
  • {BLOCKQUOTE ADDRESS}.{vspace.{before after} indent.{left right}} β€” default {0 0 5 5}. specifies how many blank lines are inserted before and after, and how many blank columns are inserted to the left and to the right of these items. (Numeric.)
  • BLOCKQUOTE.prefix β€” default empty. specifies a prefix to use for each nested level of BLOCKQUOTEs. this can be used as e.g. "> " to emulate email replies. works best with indent.left set to 0.
  • TABLE.vspace.{before after} β€” default 0. specifies how many blank lines are inserted before and after tables. (Numeric.)
  • {H1 H2 H3 H4 H5 H6}.attributes β€” default BOLD. specifies the cell attributes for headings. the value is a sequence of NONE, BOLD, UNDERLINE and STRIKETHROUGH. (Option.)
  • {TT I BIG SMALL SUB SUP DFN CODE SAMP KBD CITE}.attributes β€” default NONE. specifies the cell attributes for these text items. legal values are: NONE, BOLD, UNDERLINE or STRIKETHROUGH. (Option.)
  • U.attributes β€” default UNDERLINE. same for <U> elements, but with a different default value. (Option.)
  • {B EM STRONG}.attributes β€” default BOLD. same for these elements, but with a different default value. (Option.)
  • STRIKE.attributes β€” default STRIKETHROUGH. same for <STRIKE> elements, but with a different default value. (Option.)
  • A.attributes.{internal_link external_link} β€” default UNDERLINE. specifies the cell attributes for links. a link is an <A> element that has an "HREF" attribute. an internal link is a link whose "HREF" attribute starts with a hash character (e.g. "<A href="#42">"). legal values are again NONE, BOLD, UNDERLINE and STRIKETHROUGH. (Option.)
  • IMG.replace.{all noalt} β€” default unset. specifies the string used to replace all <IMG> elements, or those without an "ALT" attribute set. (String.)
  • IMG.alt.{prefix suffix} β€” default {[ ]}. specifies how the values (if any) of IMG elements' "ALT" attributes are marked. (String.)

🌈 AUTHOR 🌈

current primary download location for html2text is: https://gitlab.com/grobian/html2text.


🫢 SEE ALSO 🫢


and that's the whole thing, bestie!! πŸ’– this page came straight out of the File Formats Manual and it's dated 2020-04-05. you ate. go format some HTML. πŸŽ€βœ¨

πŸ“¦ where this page comes from