stackedit.js
1.0.0
모든 웹 사이트에 Stackedit을 추가하십시오
# install dependencies
npm install
# watch and build for dev
npm run dev
# build for production
npm run build Stackedit를 textarea 에 바인딩합니다.
// 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 ;
} ) ;전체 문서는 https://benweet.github.io/stackedit.js/에서 찾을 수 있습니다.