FMT(1plan9)

πŸ’– FMT(1plan9) πŸ’–

okay bestie, welcome to fmt and htmlfmt β€” the manual page for these two little text-formatting icons, straight out of the Plan 9 section 1 manuals. no cap, they're simpler than they look and they ate. πŸŽ€


✨ NAME ✨

fmt, htmlfmt β€” simple text formatters πŸ¦‹


🌸 SYNOPSIS 🌸

fmt [ option ...  ] [ file ...  ]

htmlfmt [ -a ] [ -c charset ] [ -u url ] [ file ...  ]

πŸ’… DESCRIPTION πŸ’…

So Fmt literally just copies the files you hand it (or standard input if you give it nothing, which is the default) over to its standard output, filling and indenting lines as it goes. that's the whole vibe. the options are:

  • -l n β€” output line length is n, and yes that count includes the indent (default 70). ✨
  • -w n β€” a synonym for -l. same thing, different letter, we love a flexible queen.
  • -i n β€” indent n spaces (default 0).
  • -j β€” do not join short lines: only fold long lines. like, leave the short ones alone, they're fine.

Empty lines and initial white space in input lines are preserved β€” respect the original layout, periodt. and empty lines get inserted between input files, so they don't all smoosh together. 🫢

Fmt is idempotent: it leaves already formatted text unchanged. run it twice, it's giving the same energy. iconic behaviour honestly. πŸ‘‘

Htmlfmt performs a similar service, except it accepts as input text formatted with HTML tags. it takes fmt's -l and -w flags, and also:

  • -a β€” normally htmlfmt suppresses the contents of form fields and anchors (URLs and image files); this flag makes it print them instead, in square brackets. [like this] bestie πŸŽ€
  • -c charset β€” change the default character set from iso-8859-1 to charset. this is the character set it assumes if there isn't one specified by the html itself in a <meta> directive.
  • -u url β€” use url as the base URL for the document when displaying anchors; and heads up, this one sets -a. sneaky little combo move. πŸ’…

πŸ”₯ SOURCE πŸ”₯

  • /src/cmd/fmt.c
  • /src/cmd/htmlfmt

πŸ’€ BUGS πŸ’€

Htmlfmt makes no attempt to render the two-dimensional geometry of tables; it just treats the table entries as plain, to-be-formatted text. so if you were hoping for a gorgeous grid... nope. not the moment. πŸ™ˆ


and that's the whole page, bestie β€” this was FMT(1plan9), from the Plan 9 manual, section 1, and that footer is giving very much "printed by troff, dated whenever the source said so" energy. slay. πŸ’–βœ¨

πŸ“¦ where this page comes from