- Notifications
You must be signed in to change notification settings - Fork259
A markdown editor.http://lab.lepture.com/editor/
lepture/editor
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A markdown editor you really want.
Editor is sponsored byTyplog.
Editor is not a WYSIWYG editor, it is a plain text markdown editor. Thanks for the great projectcodemirror, without which editor can never be created.
The easiest way to use Editor is to simply load the script and stylesheet:
<linkrel="stylesheet"href="http://lab.lepture.com/editor/editor.css"/><scripttype="text/javascript"src="http://lab.lepture.com/editor/editor.js"></script><scripttype="text/javascript"src="http://lab.lepture.com/editor/marked.js"></script>
You can also usejsdelivr CDN:
<linkrel="stylesheet"href="//cdn.jsdelivr.net/editor/0.1.0/editor.css"><scriptsrc="//cdn.jsdelivr.net/editor/0.1.0/editor.js"></script><scriptsrc="//cdn.jsdelivr.net/editor/0.1.0/marked.js"></script>
Having done this, an editor instance can be created:
vareditor=newEditor();editor.render();
The editor will take the position of the first<textarea> element.
To get back the edited content you use:
editor.codemirror.getValue();
If you are using component, you can install it with:
$ component install lepture/editorIf you are using seajs, you can install it with:
$ spm install lepture/editorYou can build the dist files withgrunt. After this repo is cloned, dig into the repo, and install everything you need:
$ npm install$ npm install grunt-cli -gNow you can create the dist files:
$ grunt transportYou can get everything you need in thebuild directory.
TheEditor 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)
Example:
newEditor({element:document.getElementById('editor'),toolbar:[]})
Contribution is welcome. As a way to keep all code clean, we use Grunt to build our distributed files. Make sure you have read ourContributing Guide.
MIT. Copyright (c) 2013 - 2014 by Hsiaoming Yang
About
A markdown editor.http://lab.lepture.com/editor/
Resources
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.