Provides WordQuote Blocks for the Editor.js.
Get the package
npm i --save-dev @editorjs/wquote
Include module at your application
const WordQuote = require('@editorjs/wquote');
- Upload folder
dist
from repository - Add
dist/bundle.js
file to your page.
You can load specific version of package from jsDelivr CDN.
https://cdn.jsdelivr.net/npm/@editorjs/wquote@latest
Then require this script on page with Editor.js.
<script src="..."></script>
Add a new Tool to the tools
property of the Editor.js initial config.
var editor = EditorJS({
...
tools: {
...
wquote: WordQuote,
},
...
});
Or init WordQuote Tool with additional settings
var editor = EditorJS({
...
tools: {
...
wquote: {
class: WordQuote,
inlineToolbar: true,
shortcut: 'CMD+SHIFT+O',
config: {
wquotePlaceholder: 'Enter a wquote',
captionPlaceholder: 'WordQuote\'s author',
},
},
},
...
});
Field | Type | Description |
---|---|---|
wquotePlaceholder | string |
wquote's placeholder string |
captionPlaceholder | string |
caption's placeholder string |
You can choose alignment for the wquote. It takes no effect while editing, but saved the «alignment» param.
Field | Type | Description |
---|---|---|
text | string |
wquote's text |
caption | string |
caption or an author |
alignment | string |
left or center
|
{
"type" : "wquote",
"data" : {
"text" : "The unexamined life is not worth living.",
"caption" : "Socrates",
"alignment" : "left"
}
}