{"id":13447172,"url":"https://github.com/lepture/editor","last_synced_at":"2025-05-14T22:07:40.699Z","repository":{"id":7356336,"uuid":"8680846","full_name":"lepture/editor","owner":"lepture","description":"A markdown editor. http://lab.lepture.com/editor/","archived":false,"fork":false,"pushed_at":"2017-10-09T02:58:05.000Z","size":396,"stargazers_count":2800,"open_issues_count":54,"forks_count":265,"subscribers_count":84,"default_branch":"master","last_synced_at":"2025-05-13T18:11:27.426Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://lepture.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lepture.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-10T05:07:59.000Z","updated_at":"2025-04-30T18:37:41.000Z","dependencies_parsed_at":"2022-08-27T12:21:24.937Z","dependency_job_id":null,"html_url":"https://github.com/lepture/editor","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepture%2Feditor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepture%2Feditor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepture%2Feditor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepture%2Feditor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lepture","download_url":"https://codeload.github.com/lepture/editor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235696,"owners_count":22036963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T05:01:10.050Z","updated_at":"2025-05-14T22:07:35.684Z","avatar_url":"https://github.com/lepture.png","language":"JavaScript","readme":"## Editor\n\n\u003e A markdown editor you really want.\n\n## Sponsors\n\nEditor is sponsored by [Typlog](https://typlog.com/).\n\n## Overview\n\nEditor 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.\n\n## Basic Usage\n\nThe easiest way to use Editor is to simply load the script and stylesheet:\n\n```html\n\u003clink rel=\"stylesheet\" href=\"http://lab.lepture.com/editor/editor.css\" /\u003e\n\u003cscript type=\"text/javascript\" src=\"http://lab.lepture.com/editor/editor.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"http://lab.lepture.com/editor/marked.js\"\u003e\u003c/script\u003e\n```\n\nYou can also use [jsdelivr CDN](http://www.jsdelivr.com/#!editor):\n\n```html\n\u003clink rel=\"stylesheet\" href=\"//cdn.jsdelivr.net/editor/0.1.0/editor.css\"\u003e\n\u003cscript src=\"//cdn.jsdelivr.net/editor/0.1.0/editor.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"//cdn.jsdelivr.net/editor/0.1.0/marked.js\"\u003e\u003c/script\u003e\n```\n\nHaving done this, an editor instance can be created:\n\n```js\nvar editor = new Editor();\neditor.render();\n```\n\nThe editor will take the position of the first `\u003ctextarea\u003e` element. \n\n### Get the content\n\nTo get back the edited content you use:\n\n```js\neditor.codemirror.getValue();\n```\n\n## Component\n\nIf you are using component, you can install it with:\n\n    $ component install lepture/editor\n\n\n## Seajs\n\nIf you are using seajs, you can install it with:\n\n```\n$ spm install lepture/editor\n```\n\n## Development\n\nYou can build the dist files with `grunt`. After this repo is cloned, dig into the repo, and install everything you need:\n\n```\n$ npm install\n$ npm install grunt-cli -g\n```\n\nNow you can create the dist files:\n\n```\n$ grunt transport\n```\n\nYou can get everything you need in the `build` directory.\n\n\n## Configuration\n\nThe `Editor` Class accepts an option as the parameter. The supported options are:\n\n* element (DOM)\n\n  The element of the textarea. The default value is the first `\u003ctextarea\u003e`.\n\n* tools (array or false)\n\n  If set false, the editor will have no toolbar.\n\n* status (array or false)\n\n  If set false, the editor will have no statusbar.\n\n* actions (object)\n\n* shortcuts (object)\n\n\nExample:\n```JavaScript\nnew Editor({\n  element: document.getElementById('editor'),\n  toolbar: []\n})\n```\n\n## Contributing\n\nContribution 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).\n\n## License\n\nMIT. Copyright (c) 2013 - 2014 by Hsiaoming Yang\n","funding_links":[],"categories":["JavaScript","Markdown editor","Editors","Uncategorized","Editors [🔝](#readme)","编辑器"],"sub_categories":["Runner","Uncategorized","运行器","运行器e2e测试"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flepture%2Feditor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flepture%2Feditor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flepture%2Feditor/lists"}