REFLOW(1)

πŸ“¦
version 1.17 Β· 3 versions
, in fedora 43

πŸ’– reflow β€” the girlies' guide to pretty paragraphs πŸ’–

okay so bestie, this is reflow, a Perl script from the User Contributed Perl Documentation section of your man pages (section 1, iykyk). it reflows text files using Knuth's paragraphing algorithm. no cap, it's giving typography main character energy πŸŽ€


✨ SYNOPSIS ✨

like, the vibes are literally this simple:

reflow < input > output

or if you've got a whole squad of files:

reflow file1 file2 ... > output

periodt. that's it. that's the whole interface πŸ’…


🌸 DESCRIPTION 🌸

so basically it uses Knuth's paragraphing algorithm (the exact same one TeX uses, iconic behavior) to "reflow" text files β€” meaning it picks the "good" places to break the line. not just wherever, bestie. good places. ✨

here's the tea: you give it an ascii text file, with paragraphs separated by blank lines, and it reflows those paragraphs. and if two or more lines in a row are "indented", it assumes that's a quoted poem and passes it through unchanged. protecting the poetry, as she should 🫢

heads up: the -skipindented option makes it so that ALL indented lines get passed through unchanged. just saying πŸ‘€

the algorithm is out here trying to keep the lines the same length, but it's also trying to break at punctuation, and it avoids breaking within a proper name or right after certain "connectives" ("a", "the", etc.). she has standards. πŸ’…


πŸŽ€ OPTIONS πŸŽ€

  • -skipindented β€” makes ALL indented lines get passed through unchanged. normally, a single indented line gets folded into the paragraph, while two or more indented lines are treated as a quotation or poem and passed through untouched. this flag just says "nope, all of them, leave them alone" πŸ™ˆ
  • -fast β€” sets the optimum line width to 65 characters. this is the default, so it's the lowkey no-thoughts-just-vibes mode ⭐
  • -slow β€” tries line widths of 60, 65 and 70 characters and picks the best one. she's doing the extra credit 🧚
  • -veryslow β€” tries all line widths between 60 and 70 inclusive, and picks the best one. with the -slow and -veryslow options the line widths within a paragraph will vary less, but the line widths may vary from one paragraph to the next. worth it tho πŸ”₯
  • -skipto pattern β€” skip to the first line starting with the given pattern before starting to reflow. this is useful for skipping Project Gutenberg headers or contents tables. the way it just skips the preamble... obsessed 😭
also!! see Text::Reflow(3) for more options: all the keyword options defined in Text::Reflow are also available via the reflow script. so if you want more, bestie, the door is open πŸ’œ

πŸ‘‘ AUTHOR πŸ‘‘

the original reflow perl script was written by Michael Larsen, larsen@edu.upenn.math.

modified, enhanced and converted to a perl module with XSUB by Martin Ward, martin@gkc.org.uk.

two legends fr fr 🫢


🌈 SEE ALSO 🌈

  • Text::Reflow(3).
  • perl(1).
  • see "TeX the Program" by Donald Knuth for a description of the algorithm used. like, the source material. the blueprint. the moment πŸ’…

and that's the whole page, bestie!! this was perl v5.42.0, dated 2025-07-25 β€” go forth and reflow, you're gonna slay βœ¨πŸ’–πŸ¦‹

πŸ“¦ where this page comes from