@sosuisen/milkdown-plugin-table
TypeScript icon, indicating that this package has built-in type declarations

4.11.1 • Public • Published

@milkdown/plugin-table

Table plugin for milkdown. Add support for table commands.

Example Usage

import { Editor } from '@milkdown/core';
import { commonmark } from '@milkdown/preset-commonmark';
import { nord } from '@milkdown/theme-nord';

import { table } from '@milkdown/plugin-table';

Editor.make().use(nord).use(commonmark).use(table).create();

Custom Keymap

import { tableNodes, tablePlugin, SupportedKeys, table } from '@milkdown/plugin-table';

Editor.make()
    .use(commonmark)
    .use(
        tableNodes.configure(table, {
            keymap: {
                [SupportedKeys.NextCell]: 'Enter',
                [SupportedKeys.PrevCell]: 'Alt-Enter',
            },
        }),
    )
    .use(tablePlugin)
    .create();

Keymap supported:

  • NextCell: go to next cell of table.
  • PrevCell: go to prev cell of table.
  • ExitTable: exist current table.

Package Sidebar

Install

npm i @sosuisen/milkdown-plugin-table

Weekly Downloads

0

Version

4.11.1

License

MIT

Unpacked Size

77.5 kB

Total Files

71

Last publish

Collaborators

  • sosuisen