textserver is a daemon to notify changes of a text file via HTTP long-polling. It enables Firefox to synchronize contents of textareas or input elements with an external file. You will be able to edit textareas on Firefox using an external text editor.
A guide in Japanese: d.hatena.ne.jp/tarao/20091105/1257463316
You need to have Firefox and Greasemonkey extension installed.
-
Run Firefox.
-
Install textserver daemon to your local machine. (see below)
-
Add
retrieve-remote-text.user.js
to your Greasemonkey. -
Move focus on a textarea or an input.
-
Write something to
text
file and save it. -
You will get the textarea or the input synchronized with
text
file.
If you are using Windows, you can either install by the installer or use Ruby command as in other platforms.
A demo on YouTube: www.youtube.com/watch?v=7eI12gmzv6Y
Get the installer of the latest package from up.orezdnu.org/release/textserver.msi.
text
file will be accessible from your desktop (via a shortcut named textarea
) and retrieve-remote-text.user.js
can automatically be opened just after the setup.
You need Ruby 1.8.7 or later. After cloning the repository, don’t forget to do
git submodule update --init
or install modules from github.com/tarao/gnn-rblibs.
-
Install Ruby modules listed below.
-
Make directory dir for the daemon.
-
Write ‘:dir: dir’ to a YAML file config.
-
Run the daemon with specifying config like ‘ruby textserver.rb -c config’.
You can stop the daemon by ‘ruby textserver.rb -c config –stop’.
-
rubygems (required)
-
gnn-rblibs (required)
-
inotify (recommended)
-
rubygems (required)
-
gnn-rblibs (required)
-
win32/api (required)
-
win32/process (required)
-
win32/ipc (recommended)
-
win32/event (recommended)
-
win32/changenotify (recommended)
If you have all applications listed below, you can build the installer by the following command.
rake win32
-
Rake
-
Exerb
-
Windows Installer XML (WiX) toolset
-
Microsoft Platform SDK
If you are using GNU Emacs, try elisp/textarea.el
. Put this file some where in your load path and write the following code to your .emacs
.
(require 'textarea) (setq textarea:dir "your-textserver-dir")
Then, ‘M-x textarea’ opens text
as *textarea*
buffer with auto-save mode, ‘M-x revert’ on *textarea*
buffer retrieves contents of the current textarea on the browser.