forked from appleple/smartblock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.tsx
42 lines (39 loc) · 1005 Bytes
/
demo.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import SmartBlock from './src/adapter';
import extensions from './src/extensions/';
import Code from './src/extensions/code';
import Image from './src/extensions/image';
import markdown from './sample';
import * as showdown from 'showdown';
import './css/smartblock.css';
extensions.push(new Code());
extensions.push(new Image({
imgClassName: 'small',
withCaption: false,
imgFullClassName: 'full',
}))
SmartBlock('#app', {
showTitle: true,
titlePlaceholder: 'ここにタイトルを入力',
markdown,
showdown,
outputMarkdown: true,
extensions,
onChange: ({ markdown }) => {
}
});
// JSX version
// import * as React from 'react';
// import { render } from 'react-dom';
// import SmartBlock from './src/components/smartblock';
// import extensions from './src/extensions';
//
// render(<>
// <SmartBlock
// extensions={extensions}
// html="html"
// showTitle={true}
// onChange={({html}) => console.log(html)}
// />
// </>,
// document.getElementById('app')
// );