X-Git-Url: https://jasonwoof.com/gitweb/?p=peach-html5-editor.git;a=blobdiff_plain;f=README.md;h=26edc34655851187c4de7d691f3598032fd9f265;hp=8f86eec41a4ed0a2777cad6beff053544e29a54e;hb=90fd4346459ebd1d895047622880a5d78ae419d2;hpb=a77c7e459842f78d78161bc4a3f330ec1d0c2693 diff --git a/README.md b/README.md index 8f86eec..26edc34 100644 --- a/README.md +++ b/README.md @@ -1,55 +1,99 @@ -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. The HTML5 parser can -also run under node.js. +This is a WYSIWYG HTML5 editor for the browser. Status ------ -HTML5 parser: all (1581) tests pass. Works in the browser and node.js +Early development stages. -WYSIWYG editor: planning stages +The HTML5 parser component passes the full test suite (1581 tests). +The interface is starting to exist. -Getting Started ---------------- -Recommended: see "With CoffeeScript" below +Technologies +------------ -(experimental) Alternate: see "Without Compiling" +Programming language: CoffeeScript (compiles to javascript) +Interface: Implemented using the DOM api. No ``contenteditable`` or jquery. -With CoffeeScript ------------------- -You can get CoffeeScript with a command such as this: - apt-get install coffeescript +Quick Start Guide +----------------- -or +1. Open ``parser_tests_coffee.html`` in your browser. - npm install -g coffee-script +2. Open the console (right-click, inspect this element, console) +3. After a few seconds, you should see "Tests passed: 1581, Failed: 0" in the + console. -Then, to test in the browser, run ``make``, then open ``index.html`` in your -favorite browser. +4. Try running the parser in the console, example: -Or, to run the tests on the commandline, run ``coffee test.coffee`` + window.peach_parser.parse("

foo

", {fragment: "body"}) +5. Open ``editor_tests_coffee.html`` in your browser -Without CoffeeScript ------------------ +For further reading, see "Running Under node.js" below. + + +Running Under node.js +--------------------- + +With node.js and Coffeescript, you can compile the coffeescript so you can use +the faster test pages, and you can test the html parser without a browser. + +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("

hi

", {fragment: 'body'}); + ... + +* Try using the parser in your own CoffeeScript node.js project: + + html5 = require './parser.js' + dom = html5.parse "

hi

", fragment: 'body' + ... -It is recommended to install CoffeeScript (see With CoffeeScript above), but it -should be pretty easy to get your browser to compile the CoffeScript on the -fly, to avoid installing anything. See the instructions here: + Note: the CoffeeScript compile time is significant, so you'll want to use + the compiled javascript even though you could use the ``.coffee`` version. - http://coffeescript.org/#scripts +* Hack editor.coffee more quickly, by testing in editor_tests.html which uses + the compiled version of the parser, thus speeding up load time + considerably. Feedback, Questions, Etc