lepture/editor
lepture/editor has 2,798 GitHub stars and 252 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-15 12:27 UTC. Last push 2017-10-09.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 업데이트 지연
- in 1 month
- 업데이트 지연
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
소개
A markdown editor. http://lab.lepture.com/editor/
개발 도구README.md
OriginalEditor
A markdown editor you really want.
Sponsors
Editor is sponsored by Typlog.
Overview
Editor is not a WYSIWYG editor, it is a plain text markdown editor. Thanks for the great project codemirror, without which editor can never be created.
Basic Usage
The easiest way to use Editor is to simply load the script and stylesheet:
<link rel="stylesheet" href="http://lab.lepture.com/editor/editor.css" />
<script type="text/javascript" src="http://lab.lepture.com/editor/editor.js"></script>
<script type="text/javascript" src="http://lab.lepture.com/editor/marked.js"></script>
You can also use jsdelivr CDN:
<link rel="stylesheet" href="//cdn.jsdelivr.net/editor/0.1.0/editor.css">
<script src="//cdn.jsdelivr.net/editor/0.1.0/editor.js"></script>
<script src="//cdn.jsdelivr.net/editor/0.1.0/marked.js"></script>
Having done this, an editor instance can be created:
var editor = new Editor();
editor.render();
The editor will take the position of the first <textarea> element.
Get the content
To get back the edited content you use:
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
<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:
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.
License
MIT. Copyright (c) 2013 - 2014 by Hsiaoming Yang