GhostText/readme.md
2021-02-15 19:35:46 -06:00

4.9 KiB
Raw Blame History

GhostText

Demo screencast

Use your text editor to write in your browser. Everything you type in the editor will be instantly updated in the browser (and vice versa).

Notice: GhostText generally works but it has some bugs across the various implementations. If you use it regularly please consider contributing/bugfixing your editor's GhostText plugin.

Installation

  1. Install your editor extension:

  2. Install your browser extension:

Usage

  1. Open your editor
  2. Click the GhostText button in the browsers toolbar
  3. Click inside the desired field (if theres more than one)

Notice: in some editors youll need to run the Enable GhostText command after step 1. Refer to your editors GhostText extension readme. Sublime Text does this automatically.

How it works

GhostText is split in two parts:

  • a HTTP and WebSocket server in the text editor
  • a client in the browser

When you activate GhostText by clicking the button, the browser will try contacting the server in the text editor (at the port specified in the options) and open a WebSocket connection. Every change will be transmitted to the other side. Each side can close the socket and the session will be over.

Troubleshooting

You can verify whether it works by visiting the testing page.

No supported fields found

GhostText supports the following types of fields:

  • <textarea> elements
  • contentEditable areas: like in Gmail
  • CodeMirror editors: used on CodePen, JSFiddle, JS Bin, …
  • Ace editor: used on AWS, Khan Academy, Wikipedia, …

If the website you activate it on doesn't have any of the above, it's not compatible.

Unable to connect to the editor

Ensure that:

  • Your editor is open
  • Its GhostText extension is installed
  • The GhostText server is running (in most editor extensions this is opened automatically)
  • The server port matches (it's 4001 by default, it can be changed in the options)
  • There are no other servers using the port

If it still doesn't work, try again in Sublime Text, it's the main supported editor of GhostText.

Keyboard shortcuts

You can use a keyboard shortcut instead of clicking the button. The shortcut can be changed or disabled, like this in Chrome or like this in Firefox.

OS Shortcut
Windows ctrl + shift + K
Linux ctrl + shift + H
Mac cmd + shift + K

License

MIT © Federico Brigante