X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=README.md;h=af50f19862927609a4b65f025ab2e05173586abb;hb=be45d613a601143205ac93a5359d2340983efdf5;hp=b414c02577296e6fd425f520b75a5ce9bd9a7523;hpb=68bf5e08a951f954f9e22836560f5b9b77ef8d02;p=peach-html5-editor.git diff --git a/README.md b/README.md index b414c02..af50f19 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ 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 +28,7 @@ Quick Start Guide 4. Try running the parser in the console, example: - window.wheic.parse_html("

foo

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

foo

", {fragment: "body"}) For further reading, see "Running Under node.js" below. @@ -36,35 +36,49 @@ 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: +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: +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. - nodejs test.js +* Run tests via compiled code: -5. Try using the parser in your own code: + nodejs parser_tests.js - var wheic = require('./parse-html.js'); - var dom = wheic.parse_html("

hi

", {fragment: 'body'}); +* 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' + ... + + 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 ------------------------