In other words, make a nice HTML document from a UNIX man page.
This is a modified version of cat2html originally written by Harald
Schlangmann for NeXTSTEP in 1993 and later extended by Carl Lindberg for the
ManOpen Mac app.
Minor modifications were made to make the code compile on modern macOS
systems for both x86_64 and arm64 architectures, but it should also build
and function just fine on other Unix-like systems that have lex or
flex installed.
./build_macos.shThe resulting binary will be created in the macos_bin folder.
./build.shThe resulting binary will be created in the bin folder.
A pre-built universal binary for macOS is available in the dist folder.
Usage: cat2html [-il] [<filename>]
Translate output of (g)nroff to HTML. If no
<filename> is given, cat2html reads stdin.
option -i uses italic characters for underlining.
option -l adds 'manpage:' HREF links to other man pages.
HTML output is sent to stdout./usr/bin/man -mandoc path/to/man_page.1 | ./cat2html > man_page.1.html... and many more command line tools that provide man pages viewable on the web.
(c) 1993 by Harald Schlangmann. Permission is granted to use this code.