X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=README.md;h=272da2ef2d07941a1fae14cad5530c125c93ac8c;hb=0f0011fe19f527abc6d67c7245720d5d451085f5;hp=3d463de5e05271b78754ef2e86903112c74dc121;hpb=4cff8737a670f1aeb0236d18d41bceeab4407db5;p=peach-html5-editor.git diff --git a/README.md b/README.md index 3d463de..272da2e 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,32 @@ -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. + +The HTML5 parser component passes the full test suite (1581 tests). + +The interface is starting to exist. + + +Technologies +------------ + +Programming language: CoffeeScript (compiles to javascript) + +Interface: Implemented using the DOM api. No ``contenteditable`` or jquery. -WYSIWYG editor: planning stages Quick Start Guide ----------------- -1. Open ``test.html`` in your browser. +1. Open ``parser_tests_coffee.html`` in your browser. 2. Open the console (right-click, inspect this element, console) @@ -28,7 +35,7 @@ Quick Start Guide 4. Try running the parser in the console, example: - window.wheic.parse_html("

foo

", {fragment: "body"}) + window.peach_parser.parse("

foo

", {fragment: "body"}) For further reading, see "Running Under node.js" below. @@ -36,24 +43,48 @@ For further reading, see "Running Under node.js" below. Running Under node.js --------------------- -Dependancies: node.js, coffeescript +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 -You can get CoffeeScript with a command such as this: +* Test the compiled (javascript) parser in your favorite browser by opening + up ``parser_tests.html`` and looking at the console. - apt-get install coffeescript +* Run tests via compiled code: -or + nodejs parser_tests.js - npm install -g coffee-script +* Try using the parser in your own javascript node.js project: -Now you can run the test suite like this: + var html5 = require('./parser.js'); + var dom = html5.parse("

hi

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

hi

", fragment: 'body' + ... - wheic = require './parse-html.coffee' - dom = wheic.parse_html "foo bar" + 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