@tgrosinger/md-advanced-tables
v3.11.0
Published
A text editor independent library for advanced manipulation, formatting, and spreadsheets in markdown tables.
Downloads
31
Maintainers
Readme
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.
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:
- Advanced Tables Obsidian for Obsidian.md (reference implementation)
- atom-markdown-table-editor for Atom (uses the original mte-kernel)
- table-editor for Inkdrop (uses the original mte-kernel)
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:
License
Author
Current author: Tony Grosinger (Github)