Convert man output to ebook format

conversiongroffmanpostscript

I can convert man output to PDF. First, man -t grep >grep.ps (grep is just an example; I am not looking for mobile version of grep man page). Then Adobe Distiller converts PostScript to PDF. However, PDF looks terrible on the tablet (can't re-size, etc). I see several programs that convert to mobi and epub formats, but none of them take Postscript as input. Some take PDF as input, but output is usually very difficult to read – even worse than original PDF.

So, how can I convert man output to mobile format (epub, mobi, or fb2)?

  • Change man / groff output to produce something that mobile generators like;

or

  • Convert PS to mobile format; or
  • Some other way that I can't think of…

Best Answer

You could use the open source software Calibre (http://calibre-ebook.com).

It is available for OSX, Windows, and Linux.

Input Formats: CBZ, CBR, CBC, CHM, DJVU, EPUB, FB2, HTML, HTMLZ, LIT, LRF, MOBI, ODT, PDF, PRC, PDB, PML, RB, RTF, SNB, TCR, TXT, TXTZ

Output Formats: AZW3, EPUB, FB2, OEB, LIT, LRF, MOBI, HTMLZ, PDB, PML, RB, PDF, RTF, SNB, TCR, TXT, TXTZ

I think for the best results you just output the man page to html using a manpage-to-html converter: http://dcssrv1.oit.uci.edu/indiv/ehood/man2html.html.

Related Question