Petrel is a library to create wonderful and customizable code editors
npm install petreljs
npm install petrelimport { CodeEditor } from 'petrel'
`
Module
`js
import { CodeEditor } from 'https://js.intera.dev/petrel/1.0.7/index.js'
`
JS
`html
`
Styles
NPM & Webpack
`js
require('petrel/css/dark.css')
`
Web
`html
`
Example
`html
`Options
`js
new CodeEditor(..., {
closeKeys: {
'<', '>' // If < is being typed into the editor, the editor will autocomplete it with >
},
placeholder: 'Enter code in here',
value: "Hello World",
readonly: false,
tabShortcutsEnabled: true,
tabSize: 4
})``