loongtex-code

2.8.108 • Public • Published

Code Tool for Editor.js

Code Tool for the Editor.js allows to include code examples in your articles.

Installation

Install via NPM

Get the package

npm i --save-dev @editorjs/code

Include module at your application

const CodeTool = require('@editorjs/code');

Download to your project's source dir

  1. Upload folder dist from repository
  2. Add dist/bundle.js file to your page.

Load from CDN

You can load specific version of package from jsDelivr CDN.

https://cdn.jsdelivr.net/npm/@editorjs/code@2.0.0

Require this script on a page with Editor.js.

<script src="..."></script>

Usage

Add a new Tool to the tools property of the Editor.js initial config.

var editor = EditorJS({
  ...
  
  tools: {
    ...
    code: CodeTool,
  }
  
  ...
});

Config Params

Field Type Description
placeholder string Code Tool's placeholder string

Output data

This Tool returns code.

{
    "type" : "code",
    "data" : {
        "code": "body {\n font-size: 14px;\n line-height: 16px;\n}",
    }
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.8.1081latest

Version History

VersionDownloads (Last 7 Days)Published
2.8.1081
2.8.1070
2.8.1060
2.8.1050
2.8.1040
2.8.1030
2.8.1020
2.8.1010
2.8.1000
2.8.990
2.8.980
2.8.970
2.8.960
2.8.950
2.8.940
2.8.930
2.8.920
2.8.910
2.8.900
2.8.890
2.8.880
2.8.870
2.8.860
2.8.850
2.8.840
2.8.830
2.8.820
2.8.810
2.8.800
2.8.790
2.8.780
2.8.770
2.8.760
2.8.750
2.8.740
2.8.730
2.8.720
2.8.710
2.8.700
2.8.680
2.8.670
2.8.660
2.8.650
2.8.640
2.8.630
2.8.621
2.8.610
2.8.600
2.8.590
2.8.580
2.8.570
2.8.560
2.8.550
2.8.540
2.8.521
2.8.510
2.8.500
2.8.490
2.8.480
2.8.470
2.8.460
2.8.450
2.8.440
2.8.430
2.8.420
2.8.410
2.8.400
2.8.390
2.8.380
2.8.370
2.8.360
2.8.350
2.8.340
2.8.330
2.8.320
2.8.310
2.8.300
2.8.290
2.8.280
2.8.270
2.8.250
2.8.230
2.8.220
2.8.210
2.8.200
2.8.190
2.8.181
2.8.170
2.8.150
2.8.140
2.8.130
2.8.120
2.8.110
2.8.100
2.8.80
2.8.70
2.8.60
2.8.51
2.8.40
2.8.30
2.8.20
2.8.10
2.8.00

Package Sidebar

Install

npm i loongtex-code

Weekly Downloads

5

Version

2.8.108

License

MIT

Unpacked Size

871 kB

Total Files

11

Last publish

Collaborators

  • xiaogonggong