3 ms·
On macOS you can format the man pages into a PostScript which can be distilled into a PDF by Preview and then opened there. PDFs do support links for cross refe
by kccqzy 2y ago
On macOS you can format the man pages into a PostScript which can be distilled into a PDF by Preview and then opened there. PDFs do support links for cross references. On Linux you can do the same except you will probably need to manually install ghostscript for the distillation and evince or something similar to view it.
This should not surprise anyone because roff is originally designed to be a typesetting tool and the man pages are naturally printable as a nicely formatted document.
- frou_dh 2y agohttps://kapeli.com/dash https://kapeli.com/dash for MacOS supports man pages just like any of its many other documentation sources. Simply type `man:foo`. Absolute hall of fame app IMO.
- tengwar2 2y agoPostScript: this is how I solve the biggest problem I see. I don't care about linking to other pages. I don't care about reflowing. I care very much that if you use man in the terminal, the output is really hard to read other than for short man pages. man bash, for instance, is something you could reasonably want to read, but it's about 5000 lines long and in the terminal it's hard to see the organisational structure. Reformatting as Postscript shows the pages they were meant to be. I started as a Sun admin, and we used to have paper manuals, properly typeset - and that's what you get when you use Postscript as the output. For Unix/Linux users - investigate "man -t". However - MacOS doesn't support reading Postscript now. It used to, but the feature was removed from Preview. At the risk of teaching multiple grandmothers to suck eggs, I use this script: manps () { if [ -z "$1" ] then echo usage: $FUNCNAME topic echo This will open a PostScript formatted version of the man page for \'topic\'. else man -t $1 | ps2pdf - | open -f -a /System/Applications/Preview.app fi } where ps2pdf comes from Homebrew.
- wpm 2y agoPreview can no longer directly open .ps files. For shorter man pages, I use the Terminal apps "Man Page" profile which you can get to by right clicking the command name, and selecting "View man page". Then, scroll to the bottom to render the entire thing, and Command+P > Save to PDF. For long shit, parts will get truncated (overfilling the scrollback? I have no clue), so I have to export the ps with man and convert to PDF with ps2pdf. This puts everything in a basic Times New Roman font and I hate it. Much preferred when I could directly open the output on the Mac.
- kccqzy 2y agoThe font is Times, not Times New Roman. The original PostScript standard only mandated three font sets: Times, Helvetica, Courier. Personally when reading long man pages (or any long documents), I greatly prefer a proportional type face over a monospace one like in the terminal. These days, people's hand-written markdown also overuses the backtick syntax to make too many things monospace. Using a proportional font just feels right to me.