1.0.0 • Published 3 years ago
editorjs-detailssummary v1.0.0
Details/Summary tool
Installation
Install via NPM
Get the package
npm i --save-dev editorjs-detailssummaryInclude module at your application
const DetailSummaryBlock = require('editorjs-detailssummary');Download to your project's source dir
- Upload folder distfrom repository
- Add dist/bundle.jsfile to your page.
Usage
Add a new Tool to the tools property of the CodeX Editor initial config.
var editor = CodexEditor({
  ...
  
  tools: {
    ...
    detailSummary: DetailsSummaryBlock,
  },
  
  ...
});Or init Warning Tool with additional settings
var editor = CodexEditor({
  ...
  
  tools: {
    ...
    detailSummary: {
      class:     detailSummary,
      inlineToolbar: true,
      shortcut: 'CMD+SHIFT+>',
      config: {
        titlePlaceholder: 'Summary',
        messagePlaceholder: 'Details',
      },
    },
  },
  
  ...
});Config Params
| Field | Type | Description | 
|---|---|---|
| titlePlaceholder | string | Warning Tool's title placeholder | 
| messagePlaceholder | string | Warning Tool's message placeholder | 
Output data
| Field | Type | Description | 
|---|---|---|
| title | string | warning's title | 
| message | string | warning's message | 
{
    "type" : "warning",
    "data" : {
        "title" : "Note:",
        "message" : "Avoid using this method just for lulz. It can be very dangerous opposite your daily fun stuff."
    }
}1.0.0
3 years ago