JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
update documentation
authorJason Woofenden <jason@jasonwoof.com>
Fri, 22 Jan 2016 00:33:52 +0000 (19:33 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Fri, 22 Jan 2016 00:33:52 +0000 (19:33 -0500)
README.md
parser_tests.html [new file with mode: 0644]
parser_tests_coffee.html [new file with mode: 0644]
test.html [deleted file]

index b414c02..02020d6 100644 (file)
--- 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)
 
@@ -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 test.coffee
+
+*      Test the compiled (javascript) parser in your favorite browser by opening
+       up ``parser_tests.html`` and looking at the console.
+
+*      Run tests via compiled code:
 
                nodejs test.js
 
-5.     Try using the parser in your own code:
+*      Try using the parser in your own javascript node.js project:
 
                var wheic = require('./parse-html.js');
                var dom = wheic.parse_html("<p>hi</p>", {fragment: 'body'});
                ...
 
+*      Try using the parser in your own CoffeeScript node.js project:
+
+               wheic = require './parse-html.js'
+               dom = wheic.parse_html "<p>hi</p>", 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
 ------------------------
diff --git a/parser_tests.html b/parser_tests.html
new file mode 100644 (file)
index 0000000..f0c7c82
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+       <meta charset="UTF-8">
+       <link rel="icon" href="data:;base64,iVBORw0KGgo=">
+       <title>html parser tester</title>
+</head>
+<body>
+       <h1>WHEIC html parser test page (javascript version)</h1>
+       <p>You'll need to run <code>make</code> to build the javascript files used on this page.</p>
+       <p>If you don't have node.js and CoffeeScript installed, you can <a href="parser_tests_coffee.html">use the other test page</a> which compiles the CoffeeScript files on the fly in the browser.</p>
+       <p>Check the inspector/console for test results.</p>
+       <script src="parse-html.js"></script>
+       <script src="test.js"></script>
+</body>
+</html>
diff --git a/parser_tests_coffee.html b/parser_tests_coffee.html
new file mode 100644 (file)
index 0000000..2f370ab
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+       <meta charset="UTF-8">
+       <link rel="icon" href="data:;base64,iVBORw0KGgo=">
+       <title>html parser tester</title>
+</head>
+<body>
+       <h1>WHEIC html parser test page (CoffeeScript version)</h1>
+       <p>This version of the test page compiles the CoffeeScript files in the browser, so you don't have to install CoffeeScript (or node.js).</p>
+       <p>It can take a few seconds for the tests to compile.</p>
+       <p>Check the inspector/console for test results.</p>
+       <script src="parse-html.coffee" type="text/coffeescript"></script>
+       <script src="test.coffee" type="text/coffeescript"></script>
+       <script src="coffee-script.js"></script>
+</body>
+</html>
diff --git a/test.html b/test.html
deleted file mode 100644 (file)
index 6343102..0000000
--- a/test.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-       <meta charset="UTF-8">
-       <link rel="icon" href="data:;base64,iVBORw0KGgo=">
-       <title>html parser tester</title>
-</head>
-<body>
-       <h1>WHEIC test page.</h1>
-       <p>It can take a few seconds for the tests to compile.</p>
-       <p>Check the inspector/console for test results.</p>
-       <script src="parse-html.coffee" type="text/coffeescript"></script>
-       <script src="test.coffee" type="text/coffeescript"></script>
-       <script src="coffee-script.js"></script>
-</body>
-</html>