vergil
v0.0.7
Published
A editor written with Inferno + ProseMirror
Downloads
1
Readme
Vergil
/ˈvɜːrdʒɪl/
\ /_ .__ o|
\/(/_|(_|||
_|
An editor written with Inferno + ProseMirror
Usage
See example
about usage as Component or other details.
import {render} from 'inferno';
import {h} from 'inferno-hyperscript';
import {Editor, setPlaceholder} from 'vergil';
render(
h('.wrapper',[
h(Editor, {
config: {
className: '.vergil'
, content: document.querySelector('#content')
, plugins: [
setPlaceholder('Write something here...')
]
}
// event handlers (optinal)
, onFocusIn: (instance, event) => {
// do something
event.stopImmediatePropagation();
event.preventDefault();
}
, onFocusOut: (i, e) => { ... }
, onInput: (i, e) => { ... }
// transaction hooks (optional)
, beforeDispatch: (t) => { ... }
, afterDispatch: (t) => { ... }
})
])
, document.querySelector('#editor')
);
Build
% npm run build
Test
Unit Test
: with tape
% npm test
E2E Test
: via karma
% npm run karma
: if you have `xvfb-run` (for CI environment etc.)
% xvfb-run npm run karma
License
This program is free software: you can redistribute it and/or modify it under the terms of the MIT License.
See LICENSE.
Vergil
Copyright (c) 2018 Yasuhiro Asaka