1.0.0 • Published 2 years ago

@ct-note/code v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

npm.io

Code Tool for Editor.js

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

npm.io

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

FieldTypeDescription
placeholderstringCode Tool's placeholder string

Output data

This Tool returns code.

{
    "type" : "code",
    "data" : {
        "code": "body {\n font-size: 14px;\n line-height: 16px;\n}",
    }
}
ajvacornajv-errorsanymatchansi-regexajv-keywordsaprobaarr-diffarr-unionarr-flattenassertarray-uniqueasn1.jsassign-symbolsansi-stylesasync-eachatobbabel-plugin-dynamic-import-nodebasebalanced-matchbase64-jsbig.jsbinary-extensionsbluebirdbn.jsbracesbrace-expansionbrorandbrowserify-aesbrowserify-cipherbrowserify-desbrowserify-zlibbrowserify-signbrowserslistbrowserify-rsabufferbuffer-frombuffer-xorbuiltin-status-codescacachecache-basecamelcasecaniuse-litechokidarchownrchalkchrome-trace-eventcipher-baseclass-utilscollection-visitcliuicolor-convertcolor-namecolorettecommandercommondircomponent-emitterconcat-streamconsole-browserifyconstants-browserifyconvert-source-mapconcat-mapcopy-concurrentlycopy-descriptorcore-js-compatcore-util-iscreate-ecdhcreate-hashcreate-hmaccross-spawncrypto-browserifycssesccyclistdecamelizedebugdecode-uri-componentdefine-propertiesdefine-propertydes.jsdetect-filedomain-browserdiffie-hellmanelectron-to-chromiumduplexifyemoji-regexellipticend-of-streamemojis-listenhanced-resolveerrnoescaladeescape-string-regexpeslint-scopeesrecurseestraverseesutilseventsevp_bytestokeyexecaexpand-bracketsexpand-tildeextend-shallowextglobfast-deep-equalfast-json-stable-stringifyfiggy-puddingfill-rangefind-cache-dirfind-upfindup-syncfor-inflush-write-streamfrom2fragment-cachefs-write-stream-atomicfs.realpathfunction-bindgensyncget-caller-fileget-valueget-streamglob-parentglobal-modulesglobglobal-prefixglobalsgraceful-fshas-symbolshas-flaghas-valueshas-valuehash-basehash.jshmac-drbghomedir-polyfillhttps-browserifyicss-utilsiferrieee754import-localimurmurhashindexes-ofinfer-ownerinflightinheritsiniinterpretinvariantinvert-kvis-accessor-descriptoris-binary-pathis-bufferis-data-descriptoris-descriptoris-extendableis-extglobis-fullwidth-code-pointis-globis-numberis-plain-objectis-streamis-windowsis-wslisarrayisexeisobjectjsescjs-tokensjson-parse-better-errorsjson-schema-traversejson5kind-oflcidlevenlevenaryloader-runnerloader-utilslocate-pathlodashloose-envifylru-cachemake-dirmap-cachemap-age-cleanermd5.jsmap-visitmemmicromatchmiller-rabinmimic-fnmemory-fsminimalistic-assertminimalistic-crypto-utilsminimatchminimistmixin-deepmississippimkdirpmove-concurrentlymsnanomatchneo-asyncnice-trynode-libs-browsernode-releasesnormalize-pathobject-assignobject-copynpm-run-pathobject-keysobject-visitobject.assignobject.pickonceos-localep-finallyos-browserifyp-is-promisep-deferp-limitp-locatep-tryparallel-transformpakoparse-asn1pascalcaseparse-passwdpath-browserifypath-existspath-is-absolutepath-dirnamepath-keypbkdf2path-parsepicomatchpifypkg-dirposix-character-classespostcsspostcss-modules-local-by-defaultpostcss-modules-extract-importspostcss-modules-scopepostcss-modules-valuespostcss-selector-parserprivatepostcss-value-parserprocessprocess-nextick-argspromise-inflightprrpublic-encryptpumppunycodepumpifyquerystringquerystring-es3randombytesrandomfillreadable-streamregeneratereaddirpregenerate-unicode-propertiesregenerator-runtimeregenerator-transformregex-notregexpu-coreregjsgenremove-trailing-separatorregjsparserrepeat-stringrequire-directoryrepeat-elementrequire-main-filenameresolve-cwdresolveresolve-fromresolve-urlresolve-dirretrimrafrun-queueripemd160safe-buffersafe-regexschema-utilsserialize-javascriptsemverset-blockingset-valuesetimmediatesha.jsshebang-commandshebang-regexsnapdragonsignal-exitsnapdragon-nodesource-mapsource-list-mapsnapdragon-utilsource-map-resolvesource-map-supportsource-map-urlsplit-stringssristream-browserifystream-eachstream-httpstream-shiftstring-widthstrip-ansistring_decoderstrip-eofsupports-colortapableterser-webpack-pluginterserthrough2timers-browserifyto-arraybufferto-fast-propertiesto-object-pathto-regexto-regex-rangetslibtty-browserifytypedarrayunicode-canonical-property-names-ecmascriptunicode-match-property-ecmascriptunicode-match-property-value-ecmascriptunicode-property-aliases-ecmascriptunion-valuestatic-extendunique-filenameuniqunique-slugunset-valueupathuri-jsurixurluseutilutil-deprecatev8-compile-cachevm-browserifywatchpackwatchpack-chokidar2webpack-sourceswhich-modulewhichworker-farmwrap-ansiwrappyxtendy18nyallistyargsyargs-parser
1.0.0

2 years ago