X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=README.md;h=af50f19862927609a4b65f025ab2e05173586abb;hb=be45d613a601143205ac93a5359d2340983efdf5;hp=111cd5df1155073705b1d9024102d41c45f44f66;hpb=cf969645829968285a2cd1f8bc6b8bc49822d0ea;p=peach-html5-editor.git diff --git a/README.md b/README.md index 111cd5d..af50f19 100644 --- a/README.md +++ b/README.md @@ -4,27 +4,80 @@ 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 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 + + +Quick Start Guide +----------------- + +1. Open ``parser_tests_coffee.html`` in your browser. + +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. + +4. Try running the parser in the console, example: + + window.wheic_parser.parse("

foo

", {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. -Getting Started ---------------- +* Run tests via compiled code: -You'll need coffeescript, you can hopefully get that with a command such as -this: + nodejs parser_tests.js - apt-get install coffeescript +* Try using the parser in your own javascript node.js project: -or + var html5 = require('./parser.js'); + var dom = html5.parse("

hi

", {fragment: 'body'}); + ... - npm install -g coffee-script +* Try using the parser in your own CoffeeScript node.js project: -Then run ``make`` + html5 = require './parser.js' + dom = html5.parse "

hi

", fragment: 'body' + ... -Then run the test suite by opening ``index.html`` in a modern browser. + 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