• Viewing man pages in the browser

    From Kiran@kiran@no.spam to comp.sys.mac.system on Wednesday, July 09, 2003 06:30:33
    From Newsgroup: comp.sys.mac.system

    Macosxhints.com in a July 7 hint describes a nifty app called manServer
    which displays UNIX man pages in a "web site", complete with
    hyperlinks.

    The program is described at
    http://www.squarebox.co.uk/download/manServer.shtml

    and can be downloaded at
    http://www.squarebox.co.uk/download/manServer_107.pl .

    It works really great as described, but if you have experience with it,
    I have two questions:

    1. Can it be tweaked so typing "man ls" in Terminal would open the
    html'd man page in Safari? (I can just kiss good bye to nroff.)

    2. Can I add an item to mac help menu which will open the manServer
    startup page in Safari?

    -
    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From tristero@tristero@waste.net to comp.sys.mac.system on Wednesday, July 09, 2003 11:03:55
    From Newsgroup: comp.sys.mac.system

    In article <090720030131101808%kiran@no.spam>, Kiran wrote:
    The program is described at http://www.squarebox.co.uk/download/manServer.shtml

    Cute.


    1. Can it be tweaked so typing "man ls" in Terminal would open the
    html'd man page in Safari? (I can just kiss good bye to nroff.)

    One quick-and-dirty way in tcsh:

    alias man 'open http://:8888/\!^'

    assuming you're using the default manServer port on localhost and
    Safari is your default browser. Of course this only works for the
    simplest man commands: no options, no section spec.

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From esalathe@esalathe@cascade.org (Eric Salathe) to comp.sys.mac.system on Wednesday, July 09, 2003 12:31:35
    From Newsgroup: comp.sys.mac.system

    Kiran wrote:
    The program is described at http://www.squarebox.co.uk/download/manServer.shtml

    1. Can it be tweaked so typing "man ls" in Terminal would open the
    html'd man page in Safari? (I can just kiss good bye to nroff.)

    tristero
    One quick-and-dirty way in tcsh:

    alias man 'open http://:8888/\!^'

    Since I'd rather not have manServer run perpetually as a web server, I
    wrote the little script below. I put it in ~/bin and called it wman to
    keep it different from the norman man.

    -Eric

    #!/bin/csh

    #############################################################
    # Run manServer.pl on OS X to produce temporary html source
    # open html in default web browser
    # delete temporary html
    #
    # manServer.pl is written by
    # Rolf Howarth (rolf@squarebox.co.uk)
    # and is available from
    # http://www.squarebox.co.uk/download/manServer.shtml
    #
    # E Salathe 08JUL2003 #############################################################



    # set these to appropriate locations on your system

    # location of the manServer.pl script
    set manserv = ~/bin/manServer.pl

    # location for temporary html source
    set tmp_html = ~/tmp/manpage.html

    # if no args, print usage and exit

    if($#argv != 1) then
    echo "usage: wman <command>"
    exit
    endif

    # run manserver to produce html and open in default browser

    ($manserv $1 > $tmp_html) >& /dev/null
    open $tmp_html

    # wait a few secs to be sure file opens then delete it
    (sleep 10; rm -f $tmp_html) &

    exit
    --- Synchronet 3.18b-Win32 NewsLink 1.113