JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
cleanup file/function names
[peach-html5-editor.git] / README.md
1 wheic
2 =====
3
4 This project is to build a HTML5 parser, then use that to build a WYSIWYG html
5 editor for the browser.
6
7 The code is written in CoffeeScript for modern browsers. The HTML5 parser can
8 also run under node.js.
9
10
11 Status
12 ------
13
14 HTML5 parser: all (1581) tests pass. Works in the browser and node.js
15
16 WYSIWYG editor: planning stages
17
18
19 Quick Start Guide
20 -----------------
21
22 1.      Open ``parser_tests_coffee.html`` in your browser.
23
24 2.      Open the console (right-click, inspect this element, console)
25
26 3.      After a few seconds, you should see "Tests passed: 1581, Failed: 0" in the
27         console.
28
29 4.      Try running the parser in the console, example:
30
31                 window.wheic_parser.parse("<p>foo</p>", {fragment: "body"})
32
33 For further reading, see "Running Under node.js" below.
34
35
36 Running Under node.js
37 ---------------------
38
39 Dependencies: node.js, CoffeeScript
40
41 1.      Install node.js https://nodejs.org/en/
42
43 2.      Install CoffeeScript. Try:
44
45                 apt-get install coffeescript
46         or
47
48                 npm install -g coffee-script
49
50 4.      Compile to javascript:
51
52                 make
53
54 Now you can do any of these things in any order:
55
56 *       Run the tests directly from CoffeeScript:
57
58                 coffee parser_tests.coffee
59
60 *       Test the compiled (javascript) parser in your favorite browser by opening
61         up ``parser_tests.html`` and looking at the console.
62
63 *       Run tests via compiled code:
64
65                 nodejs parser_tests.js
66
67 *       Try using the parser in your own javascript node.js project:
68
69                 var html5 = require('./parser.js');
70                 var dom = html5.parse("<p>hi</p>", {fragment: 'body'});
71                 ...
72
73 *       Try using the parser in your own CoffeeScript node.js project:
74
75                 html5 = require './parser.js'
76                 dom = html5.parse "<p>hi</p>", fragment: 'body'
77                 ...
78
79         Note: the CoffeeScript compile time is significant, so you'll want to use
80         the compiled javascript even though you could use the ``.coffee`` version.
81
82
83 Feedback, Questions, Etc
84 ------------------------
85
86 Please communicate directly with Jason Woofenden by email: jason@jasonwoof.com
87 or on freenode /msg JasonWoof