ããã¨ãã: Windows ã§ã®äºæ ã¯åããã¾ããã以ä¸ã¯ Mac 㨠Linux ã®ã¿ã§ç¢ºèªãã¦ãã¾ãã
Firefox ã§ã¯æ㯠mozexãæè¿ã¯ It's All Text ã使ã£ã¦ããã¹ãã¨ãªã¢ã emacs ã§ç·¨éãã¦ããã®ã§ãããGoogle Chrome ã§ã¯ extension ãè¦ã¤ãããªãã®ã§æ¸ã
æ®éã«ããã¹ãã¨ãªã¢ã使ã£ã¦ãã¾ããã
ããæ¨æ¥ Extensions Gallery ãã¿ã¦ããããEdit with Emacs ã¨ããããããããã®ãçºè¦ã
Chrome ã¯ã»ãã¥ãªãã£ä¸ã®çç±ã§å¤é¨ããã»ã¹ãèµ·åãããã¨ãã§ããªããããlocalhost:9292 ã« httpd ãç«ã¦ã¦ããã« XMLHttpRequest ã§ããã¹ãã¨ãªã¢ã®å 容ã POSTãã¬ã¹ãã³ã¹ã¨ãã¦è¿ã£ã¦ããå 容ãæ¸ãæ»ããã¨ããåä½ããããã®ã ããã§ãã
emacs ç¨ã«edit-server.el ã¨ãã elisp ãä»ãã¦ãã¾ããããã load-path ã«å ¥ã㦠.emacs ã§
(require 'edit-server) (edit-server-start)
ã¨ããã¨ãemacs èªä½ã localhost:9292 ã Listen ãã¾ãã
ããã¹ãã¨ãªã¢ã«ã¯ãã®ããã« [edit] ãã¿ã³ãä»ãã®ã§ããããã¯ãªãã¯ãããã¨ã§ emacs ã§ç·¨éã§ãã¾ãã
ããã§ä¸äº OK ãã¨æã£ãã®ã§ãããããã¤ãåé¡ãã
- Mac ã ã¨æ¸ãæ»ããå 容ããæ¥æ¬èª(ãã«ããã¤ã)æåãæ¶ãã(?)
- ç·¨éä¸ã« C-x C-s ããã¨çµäºãã¦ãã©ã¦ã¶ã«æ»ã£ã¦ãã¾ãã®ãä¸æº
- ç·¨éä¸ã«æã ä¿åããæçããããã®ã§
Edit with Emacs ã®ãªãã·ã§ã³ç»é¢ã«ã¯ä»¥ä¸ã®ããã«ããã¾ããã
If for some reason you don't want to use Emacs you have a couple of other options available.
- Other servers at the project site
- TextAid's Edit Server can be found here.
Emacs ã使ããããªãå ´åã¯ã»ãã®ãµã¼ãå®è£ ãããããã£ã¦ãã¨ã§ããã
æåãã¿ãã¨çµæ§åç´ãããªã®ã§ãèªå㧠PSGI ã§å®è£ ãã¦ã¿ã¾ãããhttp://gist.github.com/289476
- HTTP body ãä¸æ¦ãã³ãã©ãªãã¡ã¤ã«ã«æ¸ãè¾¼ã
- å¤é¨ã¨ãã£ã¿ (ããã§ã¯ emacsclient) èµ·å
- ç·¨éããããã¡ã¤ã«å 容ã body ã«ãã¦ã¬ã¹ãã³ã¹ãè¿ã
ã¨ããæåãã§ããã°ããããã§ãã
# -*- mode:perl -*- use strict; use warnings; use feature qw/ :5.10 /; use File::Temp qw/ tempfile /; use IO::File::WithPath; my ($client) = grep { -e $_ } qw( /usr/bin/emacsclient.emacs-snapshot /Applications/Emacs.app/Contents/MacOS/bin/emacsclient ); die "client not found" unless $client; sub { my $env = shift; my ($status, $headers, $body) = ( 200, [ "Conetnt-Type" => "text/plain" ], undef ); given ($env->{PATH_INFO}) { when (qr{^/status}) { $body = [ "OK" ]; } when (qr{^/edit}) { # HTTP body ããã³ãã©ãªãã¡ã¤ã«ã«æ¸ãè¾¼ã my ($tmpfh, $tmpfile) = tempfile(); my $buf; print $tmpfh $buf while read $env->{"psgi.input"}, $buf, 4096; close $tmpfh; # emacsclient èµ·å system($client, $tmpfile) != 0 and warn $!; # ãã³ãã©ãªãã¡ã¤ã«ã®å 容ãéä¿¡ push @$headers, ( "Content-Length" => -s $tmpfile ); $body = IO::File::WithPath->new($tmpfile); unlink $tmpfile; } default { $status = 404; $body = [ "NotFound" ]; } } return [ $status, $headers, $body ]; }
ãã¨ã¯ããã plackup --port 9292 edit-server.psgi ãªã©ã¨ãã¦èµ·åãã¦ããã° OK ã§ãã
ä»çµã¿ä¸ä¸ã¤ã®ããã¹ãã¨ãªã¢ã®ç·¨éæã«ã¯ãããã¯ãã¾ãããè¤æ°ã®ããã¹ãã¨ãªã¢ãåæã«ç·¨éããããã° Standalone::Prefork ã使ãã°å¤§ä¸å¤«ã
ã¨ãããã¨ã§ãChrome ã§ãå¿«é©ã«ããã¹ãã¨ãªã¢ãç·¨éã§ããããã«ãªãã¾ããã