Image

Imageangry_ferret wrote in Imagecpp

man2html... ideas

I recently discovered the wonderful tool man2html on my Linux system. I've figured out that the output html goes to stdout by default, but that doesn't do me much good on a console. Additionally, all of the man files are gzipped and in one of several directories...

Typing manpath prints out:
/usr/share/manpath:/usr/local/share/manpath

or some such... what I want to do (and I can use popen() within a program to redirect the output of manpath to a string variable) is have the user input the name of a man topic (say, gcc or mozilla or vim)... then, I want to search the directories returned by manpath for a file with the appropriate name.2.gz (ignoring the number, only looking for the name, the . and the .gz suffix). It should give me a string whose value is the path (i.e. "/usr/share/manpath/man/man1/bash.1.gz" for bash, at least on my system)...

From there, I think I know what to do. What I do at this point is create a temporary copy of the .gz file, decompress it, run man2html and redirect the output into a file of the same name. The program then deletes the temporary .gz file and the temporary man file, leaving us with the converted html page.