@nteract/editor
v10.1.12
Published
The editor that lives inside cells in nteract
Downloads
2,413
Readme
@nteract/editor
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.
Installation
$ yarn add @nteract/editor
$ npm install --save @nteract/editor
Usage
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={() => {}}
/>;
Documentation
We're working on adding more documentation for this component. Stay tuned by watching this repository!
Support
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.