Skip to content
Branch: master
Go to file
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

Turn any textarea into a Markdown editor, with one-click previewing via hashify.me

Resources

License

You can’t perform that action at this time.