I recommend trying Pandoc:
$ pandoc --from man --to html < input.1 > output.html
It produces HTML that is both readable and editable, the latter being important for my use case.
It can also produce a lot of other formats such as Markdown, which is nice when you're not sure which format you want to commit to yet.
There is a comment on the question that says Pandoc cannot convert from man
, but that seems to be out of date. The current version (2.13) does a decent job converting man
to html
for my example.
Furthermore, while the accepted answer suggests using groff -mandoc -Thtml
, that did not do as good a job for me as Pandoc. Specifically, I want to convert the old Flex-2.5.5 man page to html. groff
(version 1.22.4) unfortunately mangled all of the code examples (no indentation, no fixed-width font), making them difficult to read, while Pandoc brought them over as pre
sections. Additionally, the groff
output is full of explicit inline styles, while the Pandoc output uses no CSS at all, making it a better starting point for editing.
(There is an existing answer that also mentions Pandoc, and I considered editing my information into it, but I wanted to say more about my experience using it.)