This package contains components for rendering CodeMirror editors in our nteract applications. To see this package in action, you can view the source code for the nteract play application.
$ yarn add git+https://github.com/tsirysndr/nteract-editor.git
$ npm install --save git+https://github.com/tsirysndr/nteract-editor.git
The example below shows how we can use this package to create a simple code editor component.
import CodeMirrorEditor from "@nteract/editor";
<CodeMirrorEditor
cellFocused
editorFocused
completion
theme="light"
id="just-a-cell"
onFocusChange={() => {}}
focusAbove={() => {}}
focusBelow={() => {}}
kernelStatus={"not connected"}
options={{
lineNumbers: true,
extraKeys: {
"Ctrl-Space": "autocomplete",
"Ctrl-Enter": () => {},
"Cmd-Enter": () => {}
},
cursorBlinkRate: 0,
mode: "python"
}}
value={"import pandas as pd"}
onChange={() => {}}
/>;
We're working on adding more documentation for this component. Stay tuned by watching this repository!
If you experience an issue while using this package or have a feature request, please file an issue on the issue board and add the pkg:editor
label.