X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=README.md;h=b414c02577296e6fd425f520b75a5ce9bd9a7523;hb=68bf5e08a951f954f9e22836560f5b9b77ef8d02;hp=d2acc77d3e83be6fd445d9ecff0760a31682c9b2;hpb=9ecc7f55f96de835055fa7c82f66d08b7b884a36;p=peach-html5-editor.git diff --git a/README.md b/README.md index d2acc77..b414c02 100644 --- a/README.md +++ b/README.md @@ -4,49 +4,66 @@ wheic 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 code is written in CoffeeScript for modern browsers. The HTML5 parser can +also run under node.js. Status ------ -Under development +HTML5 parser: all (1581) tests pass. Works in the browser and node.js +WYSIWYG editor: planning stages -Getting Started ---------------- -Recommended: see "Compiling" below +Quick Start Guide +----------------- -(experimental) Alternate: see "Without Compiling" +1. Open ``test.html`` in your browser. +2. Open the console (right-click, inspect this element, console) -Compiling ---------- +3. After a few seconds, you should see "Tests passed: 1581, Failed: 0" in the + console. -You'll need coffeescript, you can hopefully get that with a command such as -this: +4. Try running the parser in the console, example: - apt-get install coffeescript + window.wheic.parse_html("

foo

", {fragment: "body"}) -or +For further reading, see "Running Under node.js" below. - npm install -g coffee-script -Then run ``make`` +Running Under node.js +--------------------- -Then run the test suite by opening ``index.html`` in a modern browser. +Dependancies: node.js, coffeescript +1. Install node.js https://nodejs.org/en/ -Without Compiling ------------------ +2. Install coffeescript. Try: + + apt-get install coffeescript + or + + npm install -g coffee-script + +3. You can run the tests directly from coffeescript: + + coffee test.coffee + +4. Compile to javascript: + + make + +5. Run tests via compiled code: -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: + nodejs test.js - http://coffeescript.org/#scripts +5. Try using the parser in your own code: -Please nudge Jason (see below) to make this easier. + var wheic = require('./parse-html.js'); + var dom = wheic.parse_html("

hi

", {fragment: 'body'}); + ... Feedback, Questions, Etc