I added an an "Edit this page" bookmarklet to my browser toolbar. When clicked, it causes Netscape to spawn an xterm with vi on the current document, then does a cvs commit afterwards.
I have a bookmarklet
in my Firefox toolbar that directs the browser to a special URI
like x-edit:http://foo.example.org/bar/baz
, and Firefox is
configured to send any such URIs to a shell script with that URI as its
only parameter.
That shell script then spawns an xterm window with my preferred text editor (vi) on the given file, then does an HTML validation check and a cvs commit afterwards.
Sample of my desktop after clicking the "Edit this page" bookmarklet:
javascript:void(self.location='x-edit:'+self.location);
web-edit
script to
customize it for your system
x-edit
URI
scheme. With Gnome2 and Firefox, I used these commands:
gconftool-2 -t string -s /desktop/gnome/url-handlers/x-edit/command "/home/gerald/www/people/gerald/2000/12/web-edit %s" gconftool-2 -t bool -s /desktop/gnome/url-handlers/x-edit/needs_terminal false gconftool-2 -t bool -s /desktop/gnome/url-handlers/x-edit/enabled true
The old way (may still be useful if you are not able to set up the x-edit URI scheme as needed above.)
Sample Netscape dialog box:
vi +/foo
if uri has #foo anchor?
#!/usr/bin/perl -w # # edit: CGI script to return an HTTP response with a special MIME type # that indicates that the given URI should be edited # # Gerald Oskoboiny, 6 Dec 2000 my $uri = $ENV{QUERY_STRING}; $uri =~ s,uri=,,; $uri =~ s,%3a,:,gi; # @@ should be more thorough print "Content-Type: text/x-edit-uri\n\n"; print $uri, "\n"; exit;
Last modified: $Date: 2005/09/12 21:01:38 $
Gerald Oskoboiny, <gerald@impressive.net>