JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
page down key: cursor to end if scrolled bot already
[peach-html5-editor.git] / README.md
1 Peach HTML5 Editor
2 ==================
3
4 This is a WYSIWYG HTML5 editor for the browser.
5
6
7 Status
8 ------
9
10 Early development stages.
11
12 The HTML5 parser component passes the full test suite (1581 tests).
13
14 The interface is starting to exist.
15
16
17 Technologies
18 ------------
19
20 Programming language: CoffeeScript (compiles to javascript)
21
22 Interface: Implemented using the DOM api. No ``contenteditable`` or jquery.
23
24
25
26 Quick Start Guide
27 -----------------
28
29 1.      Open ``parser_tests_coffee.html`` in your browser.
30
31 2.      Open the console (right-click, inspect this element, console)
32
33 3.      After a few seconds, you should see "Tests passed: 1581, Failed: 0" in the
34         console.
35
36 4.      Try running the parser in the console, example:
37
38                 window.peach_parser.parse("<p>foo</p>", {fragment: "body"})
39
40 5.      Open ``editor_tests_coffee.html`` in your browser
41
42 For further reading, see "Running Under node.js" below.
43
44
45 Running Under node.js
46 ---------------------
47
48 With node.js and Coffeescript, you can compile the coffeescript so you can use
49 the faster test pages, and you can test the html parser without a browser.
50
51 Dependencies: node.js, CoffeeScript
52
53 1.      Install node.js https://nodejs.org/en/
54
55 2.      Install CoffeeScript. Try:
56
57                 apt-get install coffeescript
58         or
59
60                 npm install -g coffee-script
61
62 4.      Compile to javascript:
63
64                 make
65
66 Now you can do any of these things in any order:
67
68 *       Run the tests directly from CoffeeScript:
69
70                 coffee parser_tests.coffee
71
72 *       Test the compiled (javascript) parser in your favorite browser by opening
73         up ``parser_tests.html`` and looking at the console.
74
75 *       Run tests via compiled code:
76
77                 nodejs parser_tests.js
78
79 *       Try using the parser in your own javascript node.js project:
80
81                 var html5 = require('./parser.js');
82                 var dom = html5.parse("<p>hi</p>", {fragment: 'body'});
83                 ...
84
85 *       Try using the parser in your own CoffeeScript node.js project:
86
87                 html5 = require './parser.js'
88                 dom = html5.parse "<p>hi</p>", fragment: 'body'
89                 ...
90
91         Note: the CoffeeScript compile time is significant, so you'll want to use
92         the compiled javascript even though you could use the ``.coffee`` version.
93
94 *       Hack editor.coffee more quickly, by testing in editor_tests.html which uses
95         the compiled version of the parser, thus speeding up load time
96         considerably.
97
98
99 Feedback, Questions, Etc
100 ------------------------
101
102 Please communicate directly with Jason Woofenden by email: jason@jasonwoof.com
103 or on freenode /msg JasonWoof