Skip to content

A text editor independent library to enable formatting and Excel-style navigation, and spreadsheet formulas to Markdown tables.

License

Notifications You must be signed in to change notification settings

LostCompanies/md-advanced-tables

 
 

Repository files navigation

Markdown Advanced Tables

This library can be used by any text editor to enable formatting, Excel-style navigation, and spreadsheet formulas to Markdown tables.

It was originally created by @susisu. This fork converts the project to Typescript and adds additional functionality such as table sorting, and spreadsheet capabilities.

demo

Spreadsheets and Formulas

To learn more about the spreadsheet and formula capabilities, check out the Formulas in Markdown Tables page.

Implementations

This is a list of known implementations of this library:

Installation

npm i @tgrosinger/md-advanced-tables

Usage

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);
tableEditor.formatAll(options({}));

Look at advanced-tables-obsidian as a reference implementation for more information.

Pricing

This plugin library is provided to everyone for free, however if you would like to say thanks or help support continued development, feel free to send a little my way through one of the following methods:

GitHub Sponsors Paypal BuyMeACoffee

License

MIT License

Author

Current author: Tony Grosinger (Github)

Original author: Susisu (GitHub, Twitter)

About

A text editor independent library to enable formatting and Excel-style navigation, and spreadsheet formulas to Markdown tables.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 99.1%
  • JavaScript 0.9%