From 115352a3056c8456e9998e214458c2b10875e9c7 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Tue, 16 May 2017 14:59:59 -0400 Subject: [PATCH] update docs/README --- README.md | 100 ++++++++++++++++++++---------------------------------------- index.html | 6 ++-- 2 files changed, 37 insertions(+), 69 deletions(-) diff --git a/README.md b/README.md index faf03b3..97d2628 100644 --- a/README.md +++ b/README.md @@ -1,99 +1,65 @@ Peach HTML5 Editor ================== -This is a WYSIWYG HTML5 editor for the browser. +Peach Editor is a WYSIWYG HTML5 editor for the browser. -Status +Vision ------ -Early development stages. - -The HTML5 parser component passes the full test suite (1581 tests). +Most online HTML editors are built around the "contenteditable" feature of +modern browsers. While this gives developers a lot of features right out of the +box, they must surrender almost complete control over how it works, and thus +we all get stuck using editors that are frustrating and have loads of bugs and +compatibility issues. -The interface is starting to exist. +Instead of trying to create an ever-expanding set of workarounds for the +quirks, limitations and bugs of different platforms/browsers implementation of +contenteditable, this project aims to create an HTML5 editor that does not use +this feature at all. +This method is much more work, but has the potential to make an editor that is +actually good, since all the code that makes it tick is part of the project, +and its code can be modified. -Technologies ------------- - -Programming language: CoffeeScript (compiles to javascript) - -Interface: Implemented using the DOM api. No ``contenteditable`` or jquery. +Jason couldn't find an HTML parser in JavaScript that was at all accurate +according to the HTML5 spec, so he wrote one; see ``parser.js``. +Current work is going into the GUI. -Quick Start Guide ------------------ - -1. Open ``parser_tests_coffee.html`` in your browser. +Status +------ -2. Open the console (right-click, inspect this element, console) +The HTML5 parser: complete component passes the full test suite (1581 tests). -3. After a few seconds, you should see "Tests passed: 1581, Failed: 0" in the - console. +Editor GUI: in early development stages. -4. Try running the parser in the console, example: - window.peach_parser.parse("

foo

", {fragment: "body"}) +Quick Start +----------- -5. Open ``editor_tests_coffee.html`` in your browser +Open ``index.html`` in a browser (no need for a web server) For further reading, see "Running Under node.js" below. -Running Under node.js ---------------------- - -With node.js and Coffeescript, you can compile the coffeescript so you can use -the faster test pages, and you can test the html parser without a browser. - -Dependencies: node.js, CoffeeScript - -1. Install node.js https://nodejs.org/en/ - -2. Install CoffeeScript. Try: - - apt-get install coffeescript - or - - npm install -g coffee-script - -4. Compile to javascript: - - make - -Now you can do any of these things in any order: - -* Run the tests directly from CoffeeScript: - - coffee parser_tests.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: +Technologies +------------ - nodejs parser_tests.js +Programming language: JavaScript -* Try using the parser in your own javascript node.js project: +HTML5 Parser: Spec compliant, also runs on node.js - var html5 = require('./parser.js'); - var dom = html5.parse("

hi

", {fragment: 'body'}); - ... +Interface: Implemented using the DOM api. No ``contenteditable`` or jquery. -* Try using the parser in your own CoffeeScript node.js project: - html5 = require './parser.js' - dom = html5.parse "

hi

", fragment: 'body' - ... +Running Parser with node.js +--------------------------- - Note: the CoffeeScript compile time is significant, so you'll want to use - the compiled javascript even though you could use the ``.coffee`` version. +The parser can run without the browser, try: -* Hack editor.coffee more quickly, by testing in editor_tests.html which uses - the compiled version of the parser, thus speeding up load time - considerably. + nodejs parser_tests.js Feedback, Questions, Etc diff --git a/index.html b/index.html index a071cfe..2afd5b9 100644 --- a/index.html +++ b/index.html @@ -10,8 +10,10 @@

This directory contains the source code for the Peach HTML5 Editor. Instructions on working with the code are in README.txt

-

The editor is written in coffeescript, which compiles to javascript. To make it so people can try it out, and even do some development without installing the coffescript compiler, a variety of HTML files are provided, which allow some or all of the coffeescript files to be used directly in the browser.

+

Run the demo

-

Run the demo!

+

Run parser tests

+ +

Source - AGPLv3+

-- 1.7.10.4