X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=README.md;h=b414c02577296e6fd425f520b75a5ce9bd9a7523;hb=68bf5e08a951f954f9e22836560f5b9b77ef8d02;hp=8f86eec41a4ed0a2777cad6beff053544e29a54e;hpb=a77c7e459842f78d78161bc4a3f330ec1d0c2693;p=peach-html5-editor.git diff --git a/README.md b/README.md index 8f86eec..b414c02 100644 --- a/README.md +++ b/README.md @@ -16,40 +16,54 @@ HTML5 parser: all (1581) tests pass. Works in the browser and node.js WYSIWYG editor: planning stages -Getting Started ---------------- +Quick Start Guide +----------------- -Recommended: see "With CoffeeScript" below +1. Open ``test.html`` in your browser. -(experimental) Alternate: see "Without Compiling" +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. -With CoffeeScript ------------------- +4. Try running the parser in the console, example: -You can get CoffeeScript with a command such as this: + window.wheic.parse_html("

foo

", {fragment: "body"}) - apt-get install coffeescript +For further reading, see "Running Under node.js" below. -or - npm install -g coffee-script +Running Under node.js +--------------------- +Dependancies: node.js, coffeescript -Then, to test in the browser, run ``make``, then open ``index.html`` in your -favorite browser. +1. Install node.js https://nodejs.org/en/ -Or, to run the tests on the commandline, run ``coffee test.coffee`` +2. Install coffeescript. Try: + apt-get install coffeescript + or -Without CoffeeScript ------------------ + 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: + + nodejs test.js -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: +5. Try using the parser in your own code: - http://coffeescript.org/#scripts + var wheic = require('./parse-html.js'); + var dom = wheic.parse_html("

hi

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