TROFF2HTML(1)

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

✨ NAME ✨

okay so bestie, this is the manual page for TROFF2HTML(1) β€” General Commands Manual energy β€” and the command is troff2html, which does exactly one iconic thing: convert troff output into HTML. πŸ’…βœ¨

🌸 SYNOPSIS 🌸

  • -t title β€” this is the only flag-shaped thing in the synopsis, and the page does not give extra deets about it. It’s just sitting there, mysterious, serving main character energy. πŸŽ€
  • file ... β€” the files to read. If you don’t name any, it defaults to standard input β€” yes, that part is in DESCRIPTION, but it’s still a whole vibe.

πŸ’– DESCRIPTION πŸ’–

troff2html reads the troff(1) output in the named files β€” default standard input β€” and converts them into HTML. literally that’s the whole job. 🫢

troff2html does a tolerable job with straight troff output, but it is helped by annotations, described below. (yes, β€œtolerable” is the actual word, no cap.) Its main use is for man2html (see Plan 9's httpd(8)), which converts man(1) pages into HTML and depends on a specially annotated set of man(7) macros, invoked by troff -manhtml. πŸ”₯

Troff output lines beginning

x X html ...

which are introduced by placing \X'html ...' in the input, cause the rest of the line to be interpolated into the HTML produced. Several such lines are recognized specially by troff2html. The most important are the pair

x X html manref start cp 1
x X html manref end cp 1

which are used to create HTML hyperlinks around text of the form cp(1) pointing to /magic/man2html/1/cp. πŸͺ„

troff2html is new and experimental; in time, it may improve and subsume Plan 9's ms2html(1). On the one hand, because it uses the input, ms2html can handle pic(1), eqn(1), etc., which troff2html does not handle at all; on the other hand, ms2html understands only ms(7) documents and is easily confused by complex troff constructions. troff2html has the reverse properties: it does not handle the preprocessors but its output is reliable and (modulo helper annotations) is independent of macro package. πŸ’€βœ¨

πŸ‘‘ SEE ALSO πŸ‘‘

πŸ¦‹ BUGS πŸ¦‹

Troff and HTML have different models, and they don’t mesh well in all cases. Troff's indented paragraphs are not well served in HTML, and the output of troff2html shows this. 😭


okay that’s the page, bestie. sign-off time: TROFF2HTML(1) β€” the footer is just the manual tag, with no date or version line to report. stay slay πŸ’…πŸ’–