1.0.4 • Published 4 years ago
codemirror-elm v1.0.4
Elm adapter for CodeMirror
Installation
With npm:
npm install --save codemirror-elmWith yarn:
yarn add codemirror-elmElm Configuration
Go to the elm.json file and update the source-directories field:
{
"source-directories": [
"node_modules/codemirror-elm",
// other sources
],
}If you are using webpack, you also need to update the entry field:
entry: [
// other entries
path.resolve(__dirname, 'node_modules/codemirror-elm'),
],Usage
import CodeMirror exposing (codemirror)
codemirror
{ value = "const foo = true;"
, config =
{ theme = "material"
, mode = "javascript"
, lineNumbers = True
, lineWrapping = True
, readOnly = "nocursor"
}
}See more details in the CodeMirror docs.