Ask a Question related to Mac Applications & Software, Design and Development.
-
Kiran #1
Viewing man pages in the browser
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
[url]http://www.squarebox.co.uk/download/manServer.shtml[/url]
and can be downloaded at
[url]http://www.squarebox.co.uk/download/manServer_107.pl[/url] .
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?
-
Kiran Guest
-
Viewing cfm files in a browser
I'm running an apache 2 server on windows XP with coldfusion mx 7 installed to use the apache server and not the test server that comes with... -
Viewing in Remote Browser
When I attempt to view my ASP.NET page in a browser, I receive instead a File Download screen. I am connected to a remote server via FTP and I have... -
Acrobat 7 - disable browser PDF viewing!!
I prefer that when I am using Safari if I click on a link to a PDF that it simply automatically download the whole PDF to the downloads folder I... -
IE Browser crashes when viewing PDF
HI, (also left this in the Reader forum, but thought perhaps it fit this better after all.) I work in the Corporate Communications group for CSC... -
CS Browser - colors darken while viewing in browser
I recently installed Photoshop CS. I set up color management. When I browse a set of images taken with my Sony F717 they appear in the browser (with... -
tristero #2
Re: Viewing man pages in the browser
In article <090720030131101808%kiran@no.spam>, Kiran wrote:
Cute.> The program is described at
> [url]http://www.squarebox.co.uk/download/manServer.shtml[/url]
One quick-and-dirty way in tcsh:> 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.)
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.
tristero Guest
-
Eric Salathe #3
Re: Viewing man pages in the browser
Kiran wrote:
> > The program is described at
> > [url]http://www.squarebox.co.uk/download/manServer.shtml[/url]tristero> > 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.)Since I'd rather not have manServer run perpetually as a web server, I> One quick-and-dirty way in tcsh:
>
> alias man 'open http://:8888/\!^'
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
# [url]http://www.squarebox.co.uk/download/manServer.shtml[/url]
#
# 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
Eric Salathe Guest
-
tristero #4
Re: Viewing man pages in the browser
In article <090720031308373616%kiran@no.spam>, Kiran wrote:
Right, this extremely simple alias hack assumes you give exactly one> % alias man 'open http://:8888/\!^'
> % man
> Bad ! arg selector.
argument to man: not 0, not more than one.
You can write a short shell script to be more general, I was trying to
give the easiest possible way to do what you asked. A quick script
would look like this:
#!/bin/sh
exec open http://:8888/$*
Then alias man to run that script.
?> % man ls
> chmod: [url]http://:8888/ls:[/url] No such file or directory
What happens if you type "open http://:8888/ls" directly to the csh
prompt when the manServer is running?
I'm using 'manServer -s', not the cgi thing. Not only is this>
> Also,
> % /Library/WebServer/CGI-Executables/manServer
simpler, it also lets you run the manServer without having to run
full web server.
tristero Guest
-
Eric Salathe #5
Re: Viewing man pages in the browser
Wesley Groleau wrote:
<snip>
It is failing on the open command; this is a Quartz error message.> open /Users/sysadmin/tmp/manpage.html
> kCGErrorIllegalArgument : initCGDisplayState: cannot map display interlocks.
> kCGErrorIllegalArgument : CGSNewConnection cannot get connection port
> kCGErrorIllegalArgument : CGSNewConnection cannot get connection port
> kCGErrorInvalidConnection : CGSGetEventPort: Invalid connection
> sleep 10
> [1] 900
> exit
> [localhost:~] sysadmin% rm -f /Users/sysadmin/tmp/manpage.html
>
> [localhost:~] sysadmin%
>
> So, can anyone tell me what is wrong in my 10.1.5 system?
Does this work otherwise? Try this:
% cat > test.html << $
<h1>TEST</h1>
$
% open test.html
Here's what I can think of: Are you logged into your mac as sysadmin,
or did you su to sysadmin from the shell? I think you need to execute
open as the same user account who owns the display.
-Eric
Eric Salathe Guest
-
Eric Salathe #6
Re: Viewing man pages in the browser
Kiran <kiran@no.spam> wrote
> I started personal web-sharing according to instructions and didn't
> specify any port anywhere, so I assume everything is default.> However, here is what I get:The alias tristero posted assumes you are running manServer's own web> % man ls
> chmod: [url]http://:8888/ls:[/url] No such file or directory
server (manServer -s), which is on port 8888. Apache (aka "personal
web sharing") is not at 8888, so this URL does not point to anything.
Also, Apache does not know about manServer unless you set it up thru
cgi.
Your best bet is to either use the manServer -s option on port 8888 or
eliminate the web server altoghether as in my script.
-Eric
Eric Salathe Guest
-
Eric Salathe #7
Re: Viewing man pages in the browser
By the way, my script has problems if your .cshrc does a recursive
addition to MANPATH, such as in fink's init.csh:
setenv MANPATH /sw/share/man:/sw/man:${MANPATH}:/usr/X11R6/man
manServer seems to get confused when directories are listed multiple
times in MANPATH.
fink users need to move the line "source /sw/bin/init.csh" out of
..cshrc and into .login, where it is better off. Likewise, any other
custimizations to MANPATH should be in .login.
-Eric
Eric Salathe Guest



Reply With Quote

