JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fix build scripts, document building/running
authorJason Woofenden <jason@jasonwoof.com>
Thu, 21 Jan 2016 20:21:16 +0000 (15:21 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Thu, 21 Jan 2016 20:21:16 +0000 (15:21 -0500)
Makefile
README.md

index 9bbe26a..5ae1b2b 100644 (file)
--- 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)
index 3d463de..b414c02 100644 (file)
--- 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 <b>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("<p>hi</p>", {fragment: 'body'});
+               ...
 
 
 Feedback, Questions, Etc