tsirysndr / nteract-editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 git+https://github.com/tsirysndr/nteract-editor.git
$ npm install --save git+https://github.com/tsirysndr/nteract-editor.git

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.

License

BSD-3-Clause

About

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:TypeScript 51.1%Language:JavaScript 48.9%