text editor independent part of markdown-table-editor
Switch branches/tags
Nothing to show
Clone or download
susisu Refresh package-lock.json
this removes vulnerable versions of dependencies
Latest commit 548db19 May 8, 2018


markdown-table-editor kernel

The text editor independent part of atom-markdown-table-editor.


You can try it on your browser!


npm i -S @susisu/mte-kernel


Implement an interface to the text editor.

interface ITextEditor {
  getCursorPosition(): Point;
  setCursorPosition(pos: Point): void;
  setSelectionRange(range: Range): void;
  getLastRow(): number;
  acceptsTableEdit(row: number): boolean;
  getLine(row: number): string;
  insertLine(row: number, line: string): void;
  deleteLine(row: number): void;
  replaceLines(startRow: number, endRow: number, lines: Array<string>): void;
  transact(func: Function): void;

And then you can execute commands through a TableEditor object.

import { TableEditor, options } from "@susisu/mte-kernel";
const textEditor = ...; // interface to the text editor
const tableEditor = new TableEditor(textEditor);

See the API reference for more information. It is also good to look into atom-markdown-table-editor as a reference implementation.


MIT License


Susisu (GitHub, Twitter)