Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lepture/editor
A markdown editor. http://lab.lepture.com/editor/
https://github.com/lepture/editor
Last synced: 20 days ago
JSON representation
A markdown editor. http://lab.lepture.com/editor/
- Host: GitHub
- URL: https://github.com/lepture/editor
- Owner: lepture
- Created: 2013-03-10T05:07:59.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-10-09T02:58:05.000Z (about 7 years ago)
- Last Synced: 2024-10-01T11:41:10.069Z (about 1 month ago)
- Language: JavaScript
- Homepage: https://lepture.com/
- Size: 387 KB
- Stars: 2,794
- Watchers: 86
- Forks: 265
- Open Issues: 54
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
- awesome-web-editor - editor - A markdown editor. (Markdown editor)
- awesome-github-star - editor
- starred-awesome - editor - A markdown editor. http://lab.lepture.com/editor/ (JavaScript)
- awesome-javascript - editor - A markdown editor. - ★ 2593 (Editors)
README
## Editor
> A markdown editor you really want.
## Sponsors
Editor is sponsored by [Typlog](https://typlog.com/).
## Overview
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.
## Basic Usage
The easiest way to use Editor is to simply load the script and stylesheet:
```html
```
You can also use [jsdelivr CDN](http://www.jsdelivr.com/#!editor):
```html
```
Having done this, an editor instance can be created:
```js
var editor = new Editor();
editor.render();
```The editor will take the position of the first `` element.
### Get the content
To get back the edited content you use:
```js
editor.codemirror.getValue();
```## Component
If you are using component, you can install it with:
$ component install lepture/editor
## Seajs
If you are using seajs, you can install it with:
```
$ spm install lepture/editor
```## Development
You can build the dist files with `grunt`. After this repo is cloned, dig into the repo, and install everything you 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 ``.
* 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)
Example:
```JavaScript
new Editor({
element: document.getElementById('editor'),
toolbar: []
})
```## 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
MIT. Copyright (c) 2013 - 2014 by Hsiaoming Yang