Turn any textarea into a Markdown editor, with one-click previewing via hashify.me
JavaScript CSS CoffeeScript Makefile HTML Vim script
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
extras tests: add simple Vim syntax file Dec 22, 2013
src
test
.gitignore
LICENSE
Makefile
README.md
bower.json
hashify-editor-test-document@2x.png
hashify-editor.css
hashify-editor.js
hashify-editor@2x.png
package.json

README.md

Hashify Editor

Hashify Editor turns any textarea into a capable Markdown editor. It's similar to John Fraser's wmd, but more modular and much lighter weight.

Hashify Editor

API

Hashify.editor

Turns a textarea into a Markdown editor.

Hashify.editor(id [, preview [, callback]])

Parameters

id

The id of a textarea, or a textarea node.

preview

Boolean which determines whether the "preview" link is included. Defaults to true.

callback

Function to be invoked every time Hashify Editor handles an event. Within the function, this refers to the textarea. Hashify, for example, uses a callback to update the URL with each keystroke.

Example

Hashify.editor(editor, false, function () {
  setLocation(Hashify.encode(this.value));
});

Hashify.encode

Returns the Base64-encoded representation of a binary input string.

Hashify.encode(text)

Hashify.decode

Returns the binary representation of a Base64-encoded input string.

Hashify.decode(text)

Testing changes

Automated testing of behaviour which depends on keyboard events is problematic for several reasons. As a result, testing Hashify Editor is currently a manual process, albeit a rather pleasant one:

Hashify Editor test document

Run the following commands to open the above document:

make setup  # install dev dependencies
make test   # start the development server
open http://localhost:3456