-wheic
-=====
+Peach HTML5 Editor
+==================
-This project is to build a HTML5 parser, then use that to build a WYSIWYG html
-editor for the browser.
-
-The code is written in coffeescript for modern browsers.
+This is a WYSIWYG HTML5 editor for the browser.
Status
------
-Under development
+Early development stages.
+The HTML5 parser component passes the full test suite (1581 tests).
-Getting Started
----------------
+The interface is starting to exist.
-Recommended: see "Compiling" below
-(experimental) Alternate: see "Without Compiling"
+Technologies
+------------
+Programming language: CoffeeScript (compiles to javascript)
-Compiling
----------
+Interface: Implemented using the DOM api. No ``contenteditable`` or jquery.
-You'll need coffeescript, you can hopefully get that with a command such as
-this:
- apt-get install coffeescript
-or
+Quick Start Guide
+-----------------
- npm install -g coffee-script
+1. Open ``parser_tests_coffee.html`` in your browser.
-Then run ``make``
+2. Open the console (right-click, inspect this element, console)
-Then run the test suite by opening ``index.html`` in a modern browser.
+3. After a few seconds, you should see "Tests passed: 1581, Failed: 0" in the
+ console.
+4. Try running the parser in the console, example:
-Without Compiling
------------------
+ window.peach_parser.parse("<p>foo</p>", {fragment: "body"})
+
+For further reading, see "Running Under node.js" below.
+
+
+Running Under node.js
+---------------------
+
+Dependencies: node.js, CoffeeScript
+
+1. Install node.js https://nodejs.org/en/
+
+2. Install CoffeeScript. Try:
+
+ apt-get install coffeescript
+ or
+
+ npm install -g coffee-script
+
+4. Compile to javascript:
+
+ make
+
+Now you can do any of these things in any order:
+
+* Run the tests directly from CoffeeScript:
+
+ coffee parser_tests.coffee
+
+* Test the compiled (javascript) parser in your favorite browser by opening
+ up ``parser_tests.html`` and looking at the console.
+
+* Run tests via compiled code:
+
+ nodejs parser_tests.js
+
+* Try using the parser in your own javascript node.js project:
+
+ var html5 = require('./parser.js');
+ var dom = html5.parse("<p>hi</p>", {fragment: 'body'});
+ ...
-It is recommended to install coffeescript (see Compiling above), but you might
-be able to got it to compile directly in the browser, see here:
+* Try using the parser in your own CoffeeScript node.js project:
- http://coffeescript.org/#scripts
+ html5 = require './parser.js'
+ dom = html5.parse "<p>hi</p>", fragment: 'body'
+ ...
-Please nudge Jason (see below) to make this easier.
+ Note: the CoffeeScript compile time is significant, so you'll want to use
+ the compiled javascript even though you could use the ``.coffee`` version.
Feedback, Questions, Etc