From: Jason Woofenden Date: Thu, 21 Jan 2016 20:21:16 +0000 (-0500) Subject: fix build scripts, document building/running X-Git-Url: https://jasonwoof.com/gitweb/?p=peach-html5-editor.git;a=commitdiff_plain;h=68bf5e08a951f954f9e22836560f5b9b77ef8d02 fix build scripts, document building/running --- diff --git a/Makefile b/Makefile index 9bbe26a..5ae1b2b 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ -OBJECTS= parse-html.js test.js +OBJECTS= parse-html.js test.js html5-named-entities.js all: $(OBJECTS) %.js: %.coffee - coffee -c $< + coffee -c $< && sed -i -e 's/\(parse-html\|html5-named-entities\)[.]coffee/\1.js/g' $@ clean: rm -f $(OBJECTS) diff --git a/README.md b/README.md index 3d463de..b414c02 100644 --- a/README.md +++ b/README.md @@ -38,22 +38,32 @@ Running Under node.js Dependancies: node.js, coffeescript -You can get CoffeeScript with a command such as this: +1. Install node.js https://nodejs.org/en/ - apt-get install coffeescript +2. Install coffeescript. Try: -or + apt-get install coffeescript + or - npm install -g coffee-script + npm install -g coffee-script -Now you can run the test suite like this: +3. You can run the tests directly from coffeescript: - coffee test.coffee + coffee test.coffee -Or use the parser from your own code: +4. Compile to javascript: - wheic = require './parse-html.coffee' - dom = wheic.parse_html "foo bar" + make + +5. Run tests via compiled code: + + nodejs test.js + +5. Try using the parser in your own code: + + var wheic = require('./parse-html.js'); + var dom = wheic.parse_html("

hi

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