Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benweet/stackedit.js
Add StackEdit to any website
https://github.com/benweet/stackedit.js
editor markdown markdown-editor stackedit
Last synced: 28 days ago
JSON representation
Add StackEdit to any website
- Host: GitHub
- URL: https://github.com/benweet/stackedit.js
- Owner: benweet
- License: mit
- Created: 2018-03-12T23:30:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-01T12:32:44.000Z (over 3 years ago)
- Last Synced: 2024-05-11T05:02:41.396Z (about 2 months ago)
- Topics: editor, markdown, markdown-editor, stackedit
- Language: JavaScript
- Homepage: https://benweet.github.io/stackedit.js/
- Size: 141 KB
- Stars: 1,049
- Watchers: 27
- Forks: 119
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- my-awesome-stars - stackedit.js
- awesome-stars - stackedit.js - Add StackEdit to any website (JavaScript)
- awesome-starred - benweet/stackedit.js - Add StackEdit to any website (markdown)
- awesome - stackedit.js - Add StackEdit to any website (JavaScript)
- awesome-stars - benweet/stackedit.js - Add StackEdit to any website (markdown)
- awesome-stars - stackedit.js
- jimsghstars - benweet/stackedit.js - Add StackEdit to any website (JavaScript)
- awesome-web-editor - stackedit.js - Add StackEdit to any website. (Markdown editor)
- awesome-stars - benweet/stackedit.js - Add StackEdit to any website (JavaScript)
README
# stackedit.js
[![Build Status](https://img.shields.io/travis/benweet/stackedit.js.svg?style=flat)](https://travis-ci.org/benweet/stackedit.js) [![NPM version](https://img.shields.io/npm/v/stackedit-js.svg?style=flat)](https://www.npmjs.org/package/stackedit-js)
> Add StackEdit to any website
### Build setup
``` bash
# install dependencies
npm install# watch and build for dev
npm run dev# build for production
npm run build
```### Quick start
Bind StackEdit to a `textarea`:
```js
// Import the lib.
import Stackedit from 'stackedit-js';// Get the textarea.
const el = document.querySelector('textarea');// Create the Stackedit object.
const stackedit = new Stackedit();// Open the iframe
stackedit.openFile({
name: 'Filename', // with a filename
content: {
text: el.value // and the Markdown content.
}
});// Listen to StackEdit events and apply the changes to the textarea.
stackedit.on('fileChange', (file) => {
el.value = file.content.text;
});
```### Documentation
Full documentation can be found at https://benweet.github.io/stackedit.js/.