Permalink
Browse files

docs for editor

  • Loading branch information...
1 parent f31c949 commit f1500b2c5773ca453b18c5c50c19c9525e8d39a1 Hsiaoming Yang committed Mar 23, 2013
Showing with 89 additions and 26 deletions.
  1. +17 −0 CONTRIBUTING.md
  2. +72 −26 README.md
  3. BIN docs/preview.png
View
@@ -20,6 +20,23 @@ A little hint to make things simple:
- when you cloned this repo, run ``npm install``
- check the code style with ``grunt jshint``
+## Grunt
+
+If you haven't installed `grunt` yet, grab the command line:
+
+```
+$ npm install grunt-cli -g
+```
+
+Create a livereload server for your development:
+
+```
+$ grunt server
+```
+
+And open your browser at `http://localhost:8000`.
+
+The source code is in `src`.
## Git Help
View
@@ -1,44 +1,90 @@
# Editor
-A markdown editor.
+> A markdown editor you really want.
+## Overview
-## Development
+Editor is not a WYSIWYG editor, it is a plain text markdown editor. Thanks for the great project [codemirror](http://codemirror.net/), without which editor can never be created.
-Something you need for development.
+![Editor Preview](./docs/preview.png)
-If you don't have a node environment, get one.
+## Basic Usage
-1. Install grunt:
+The easiest way to use Editor is to simply load the script and stylesheet:
- ```
- $ npm install grunt-cli
- ```
+```html
+<link rel="stylesheet" href="http://lab.lepture.com/editor/css/editor.css" />
+<script type="text/javascript" src="http://lab.lepture.com/editor/js/editor.js"></script>
+```
-2. Fork and clone the repo
+Having done this, an editor instance can be created:
-3. Install requirements:
+```js
+var editor = new Editor();
+editor.render();
+```
- ```
- $ npm install
- ```
+The editor will take the position of the first `<textarea>` element.
-4. Lint your code:
- ```
- $ grunt jshint
- ```
+## Get the Code
-5. Build the code:
+**seajs**
- ```
- $ grunt transport
- ```
+I didn't keep the dist files in this repo. If you are a fan of `seajs`, and a user of `spm`, you can grab the code with:
-6. Start the livereload server:
+```
+$ spm install lepture/editor
+```
- ```
- $ grunt server
- ```
+**build**
-Now you open `http://localhost:8000` with your brower.
+You can build the dist files with `grunt`. After this repo is cloned, dig into the repo, and install everything your need:
+
+```
+$ npm install
+$ npm install grunt-cli -g
+```
+
+Now you can create the dist files:
+
+```
+$ grunt transport
+```
+
+You can get everything you need in the `build` directory.
+
+## Configuration
+
+The `Editor` Class accepts an option as the parameter. The supported options are:
+
+* element (DOM)
+
+ The element of the textarea. The default value is the first `<textarea>`.
+
+* tools (array or false)
+
+ If set false, the editor will have no toolbar.
+
+* status (array or false)
+
+ If set false, the editor will have no statusbar.
+
+* actions (object)
+
+* shortcuts (object)
+
+
+## Contributing
+
+Contribution is welcome. As a way to keep all code clean, we use Grunt to build our distributed files. Make sure you have read our [Contributing Guide](./CONTRIBUTING.md).
+
+## License
+
+Copyright (c) 2013 Hsiaoming Yang
+
+Permission is hereby granted, free of charge to any noncommercial projects (paid for commercial support), including the rights to use, copy, modify, merge of the Software. Limitation of the rights to publish, distribute, and/or sell copies of the Software.
+
+The above copyright notice and this permission notice shall be included in all copies of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f1500b2

Please sign in to comment.