Skip to content

tarao/textserver

Repository files navigation

textserver

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

How to use it

You need to have Firefox and Greasemonkey extension installed.

  1. Run Firefox.

  2. Install textserver daemon to your local machine. (see below)

  3. Add retrieve-remote-text.user.js to your Greasemonkey.

  4. Move focus on a textarea or an input.

  5. Write something to text file and save it.

  6. You will get the textarea or the input synchronized with text file.

Installation

If you are using Windows, you can either install by the installer or use Ruby command as in other platforms.

Using installer (Windows)

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.

How to run with source code (all platforms)

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.

  1. Install Ruby modules listed below.

  2. Make directory dir for the daemon.

  3. Write ‘:dir: dir’ to a YAML file config.

  4. Run the daemon with specifying config like ‘ruby textserver.rb -c config’.

You can stop the daemon by ‘ruby textserver.rb -c config –stop’.

Linux

  • rubygems (required)

  • gnn-rblibs (required)

  • inotify (recommended)

Windows

  • rubygems (required)

  • gnn-rblibs (required)

  • win32/api (required)

  • win32/process (required)

  • win32/ipc (recommended)

  • win32/event (recommended)

  • win32/changenotify (recommended)

Build installer on Windows

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

Advanced feature

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.

About

Edit on Firefox using external text editors.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published