HTMLROFF(1)

πŸ“¦ version 0_git20260208, in alpine 3.24, arch rolling, nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

htmlroff β€” HTML formatting and typesetting, bestie. She's from the General Commands Manual, and she is literally here to take your troff vibes and make them browser-ready. Periodt.

✨ SYNOPSIS ✨

htmlroff [ -iuv ] [ -m name ] [ -r aN ] [ file ...  ]

That's the whole invocation, no cap. πŸŽ€

🌸 DESCRIPTION 🌸

Okay so htmlroff accepts troff(1) input in the named files and formats it as HTML for viewing in a web browser. It's giving "roff goes web" and honestly? Iconic.

If no file argument is given, htmlroff reads the standard input. An argument consisting of a single minus (-) is taken to be a file name corresponding to the standard input. We love a flexible stdin moment. πŸ’…

The options are:

  • -i β€” Read standard input after the input files are exhausted. So she keeps reading after the named files run out, bestie.
  • -mname β€” Process the macro file /tmac/tmac.name before the input files. Note the synopsis spells it -m name, but the option label is exactly -mname.
  • -raN β€” Set register a (one character name) to N. Yep, the synopsis shows -r aN, and the option is exactly -raN.
  • -u β€” Generate UTF output. By default, htmlroff converts Unicode runes into the corresponding HTML entity sequences (α,  , and so on). htmlroff invokes tcs(1) for the conversion. Cute little entity factory, fr fr.
  • -v β€” Generate debugging output and warnings about suspicious input. Messy input? She will absolutely tell you. πŸ‘€

Most troff input files, especially those using the ms(7) macros, can be used unaltered. In general, the macro file tmac.html should be processed after processing other standard macro files, as in htmlroff -ms -mhtml. That ordering is the moment β€” process tmac.html after the other standard macro files, okay? 🫢

htmlroff(7) describes the changes to the input language.

mhtml(7) describes the new macros.

πŸŽ€ EXAMPLES πŸŽ€

Format the Plan 9 web page:

cd /usr/web/plan9
htmlroff -mhtml index.tr >index.html

Format a paper:

cd /sys/doc
pic auth.ms | tbl | eqn | htmlroff -ms -mhtml >auth.html

Pipeline girlies, rise. The pic auth.ms | tbl | eqn | htmlroff -ms -mhtml >auth.html line is a whole main-character moment. πŸ”₯

πŸ¦‹ FILES πŸ¦‹

  • /troff/font/devutf/utfmap β€” Mapping from troff two-character names like \(*a to Unicode characters like Ξ±. Translation station, but make it typography. ✨

🌈 SOURCE 🌈

  • /src/cmd/htmlroff β€” the source, periodt. That's where this cutie lives. πŸ’œ

πŸ‘‘ SEE ALSO πŸ‘‘


okay that's the whole HTMLROFF(1) tea from the General Commands Manual β€” the footer is just the HTMLROFF(1) tag, with no extra source/version/date line beyond that, so that's the entire stack. mwah πŸ’‹πŸŽ€