3 ms·
Absolutely - I can't buy into the "don't write man pages" idea. For many years I've had this function in my RC files for macOS: pman() { man -t "$@" | ope
by jen20 6y ago
Absolutely - I can't buy into the "don't write man pages" idea.
For many years I've had this function in my RC files for macOS:
pman() { man -t "$@" | open -f -a Preview; }
It opens the given man page in Preview, typeset beautifully. No such thing is available for random text printed to the console, nor is a console pager (as recommended by this article) an acceptable substitute for this.
- timsneath 6y agoWhat a fantastic tip. Thanks for sharing!
- mongol 6y agoWhat is Preview?
- waterhouse 6y agoMac OS's built-in PDF viewer, which also views images and—relevant here—Postscript files.
- kilroy123 6y agoWhat a good idea! Thanks for this, added to my aliases.
- nocman 6y agoFor those on Linux you can do this with: f=$(mktemp);man -t "$@" > "$f" && ( {some-pdf-viewer} "$f" ; rm "$f" ) ... replacing '{some-pdf-viewer}' with whatever PDF viewer works for you. There is probably one that will take the document on stdin, but I am not aware of one. I realize I'm late to the party here, but thought is was worth posting anyway. (edited for typo)
- dTal 6y agoWith BSD man (default on Void Linux) you can do: MANPAGER=<some-pdf-viewer> man -T pdf <command>
- solatic 6y agoYou should be able to avoid using mktemp by: pman='some-pdf-viewer <(man -t "$@")'
- solatic 6y agoApparently not possible for PDFs, see https://superuser.com/questions/1243405/using-process-substitution-or-similar-to-display-man-pages-as-pdf-w-o-tempfile https://superuser.com/questions/1243405/using-process-substi... . TIL
- oars 6y agoThank you for sharing this tip!