|
1 | | -# Logseq Inline Markdown Table Editor Plugin |
| 1 | +# Logseq Advanced Markdown Table Editor |
2 | 2 |
|
3 | | -[](https://github.com/haydenull/logseq-plugin-markdown-table/releases) |
4 | | -[](https://github.com/haydenull/logseq-plugin-markdown-table/blob/main/LICENSE) |
| 3 | +An advanced markdown table editor for [Logseq](https://logseq.com). Blocks whose content is a markdown table are rendered as a real, editable table — click a cell to edit, use the toolbar / right-click menu / keyboard shortcuts to add, move, delete or sort rows and columns. The block's raw markdown stays the source of truth. |
5 | 4 |
|
6 | 5 | English | [简体中文](./README-zh_CN.md) |
7 | 6 |
|
8 | | -reference[https://codesandbox.io/s/yt8jc](https://codesandbox.io/s/yt8jc) |
| 7 | + |
9 | 8 |
|
10 | | -## Read Before Use |
| 9 | +## Table of contents |
11 | 10 |
|
12 | | -- **Multiple tables need to be separated by blank lines, otherwise they will be recognized as one table** |
| 11 | +- [Features](#features) |
| 12 | +- [Installation](#installation) |
| 13 | +- [Usage](#usage) |
| 14 | +- [Keyboard shortcuts](#keyboard-shortcuts) |
| 15 | +- [Settings](#settings) |
| 16 | +- [Notes & limitations](#notes--limitations) |
| 17 | +- [Development](#development) |
| 18 | +- [License](#license) |
13 | 19 |
|
14 | | -## demo |
| 20 | +## Features |
15 | 21 |
|
16 | | - |
| 22 | +- **Inline editing** — markdown-table blocks render as a live, contenteditable table directly in the Logseq outliner. No modal, no separate panel. |
| 23 | +- **Toolbar & context menu** — pinned toolbar above the focused table (toggleable) plus a right-click menu, both offering insert / move / delete / sort actions. |
| 24 | +- **Maximise** — expand the table to fill the Logseq window for editing wide data, then collapse it back. |
| 25 | +- **Sort columns** ascending or descending. |
| 26 | +- **Drag-to-reorder** rows and columns from the table's top/left edge. |
| 27 | +- **Slash command** to insert a starter table at the caret. |
| 28 | +- **Keyboard-first editing** — every structural operation has a default keybinding, all rebindable from Logseq's Keymap UI. |
| 29 | +- **Monospace source view** — when you drop into the raw markdown, the textarea switches to a monospace font so aligned tables actually line up. |
17 | 30 |
|
18 | | -## Shortcuts |
| 31 | +## Installation |
19 | 32 |
|
20 | | -- `Tab`: Move cursor to the next cell |
21 | | -- `Shift + Tab`: Move cursor to the previous cell |
22 | | -- `Shift + Enter`: Break line in the current cell |
| 33 | +### From the Logseq marketplace |
23 | 34 |
|
24 | | -## Development |
| 35 | +1. In Logseq, open **Settings → Features** and enable **Plug-in system**. |
| 36 | +2. Click the **Marketplace** icon in the top-right plugin bar. |
| 37 | +3. Search for _Advanced Markdown Table Editor_ and click **Install**. |
| 38 | + |
| 39 | +### Manual install (unpacked) |
| 40 | + |
| 41 | +1. Download the latest `.zip` from the [Releases](https://github.com/VictorVow/logseq-plugin-markdown-table/releases) page and extract it. |
| 42 | +2. In Logseq, open **Settings → Plugins → Load unpacked plugin** and select the extracted folder. |
| 43 | + |
| 44 | +### From source |
25 | 45 |
|
26 | 46 | ```shell |
| 47 | +git clone https://github.com/VictorVow/logseq-plugin-markdown-table |
| 48 | +cd logseq-plugin-markdown-table |
27 | 49 | npm install |
| 50 | +npm run build |
| 51 | +``` |
| 52 | + |
| 53 | +Then load the project folder via **Load unpacked plugin** in Logseq. |
| 54 | + |
| 55 | +## Usage |
| 56 | + |
| 57 | +- **Insert a table**: type `/Markdown Table Editor` in any block — a minimal 1×1 table is inserted and focus drops into the header cell. |
| 58 | +- **Edit a cell**: click any cell and type. Changes are debounced and written back to the block's markdown automatically. |
| 59 | +- **Reorganise structure**: use the keyboard shortcuts below, the pinned toolbar above the focused table, or right-click for the full menu. |
| 60 | +- **Maximise**: click the maximise button in the toolbar (or the menu entry) to expand the table to the full Logseq window; `Esc` exits. |
| 61 | +- **Drag to reorder**: hover the table's top edge to grab a column, or the left edge to grab a row, then drag. |
| 62 | + |
| 63 | +## Keyboard shortcuts |
| 64 | + |
| 65 | +All shortcuts below are registered as Logseq commands, so you can rebind them from **Settings → Keymap** (search for _Markdown table_). The defaults are: |
| 66 | + |
| 67 | +### Caret navigation (inside a cell) |
| 68 | + |
| 69 | +| Action | Default | |
| 70 | +| ------------------------ | ---------------------------------- | |
| 71 | +| Move caret to cell below | `Ctrl+Alt+Down` / `Ctrl+Enter` | |
| 72 | +| Move caret to cell above | `Ctrl+Alt+Up` / `Ctrl+Shift+Enter` | |
| 73 | +| Move caret to cell left | `Ctrl+Alt+Left` | |
| 74 | +| Move caret to cell right | `Ctrl+Alt+Right` | |
| 75 | + |
| 76 | +### Insert rows & columns |
| 77 | + |
| 78 | +| Action | Default | |
| 79 | +| ------------------- | ---------------------- | |
| 80 | +| Insert row below | `Ctrl+Alt+Shift+Down` | |
| 81 | +| Insert row above | `Ctrl+Alt+Shift+Up` | |
| 82 | +| Insert column right | `Ctrl+Alt+Shift+Right` | |
| 83 | +| Insert column left | `Ctrl+Alt+Shift+Left` | |
| 84 | + |
| 85 | +### Move rows & columns |
| 86 | + |
| 87 | +| Action | Default | |
| 88 | +| ----------------- | ----------------- | |
| 89 | +| Move row up | `Alt+Shift+Up` | |
| 90 | +| Move row down | `Alt+Shift+Down` | |
| 91 | +| Move column left | `Alt+Shift+Left` | |
| 92 | +| Move column right | `Alt+Shift+Right` | |
28 | 93 |
|
29 | | -npm start |
| 94 | +### Delete rows & columns |
| 95 | + |
| 96 | +| Action | Default | |
| 97 | +| ------------- | ---------------- | |
| 98 | +| Delete row | `Ctrl+Backspace` | |
| 99 | +| Delete column | `Ctrl+Delete` | |
| 100 | + |
| 101 | +The header row cannot be deleted, and the last remaining row/column is protected. |
| 102 | + |
| 103 | +### Editing helpers |
| 104 | + |
| 105 | +| Action | Default | |
| 106 | +| ------------------------------------------- | ------------- | |
| 107 | +| Insert a line break inside the current cell | `Shift+Enter` | |
| 108 | +| Exit maximise mode | `Esc` | |
| 109 | + |
| 110 | +## Settings |
| 111 | + |
| 112 | +Available under **Settings → Plugin settings → Advanced Markdown Table Editor**: |
| 113 | + |
| 114 | +| Setting | Default | What it does | |
| 115 | +| ----------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- | |
| 116 | +| **Inline edit auto-save delay (ms)** | `500` | How long after you stop typing in a cell before the change is written back to the block. | |
| 117 | +| **Monospace table source when editing** | `on` | While editing the raw markdown of a table block, render the textarea in a monospace font so aligned tables line up. | |
| 118 | +| **Monospace table font size offset (px)** | `-1` | Adjust the monospace source font size relative to Logseq's base font (e.g. `-1` = 1px smaller, `0` = same, `2` = 2px larger). | |
| 119 | +| **Pin inline table toolbar by default** | `on` | Keep the toolbar pinned above the focused table. Can also be toggled at runtime from the toolbar / right-click menu. | |
| 120 | + |
| 121 | +Reload the plugin after changing any of these. |
| 122 | + |
| 123 | +## Notes & limitations |
| 124 | + |
| 125 | +- **Markdown-only blocks.** The renderer only activates on blocks whose format is markdown. |
| 126 | +- **Multiple tables in one block** must be separated by a blank line — otherwise they're parsed as a single table. |
| 127 | +- **Header row required.** A markdown table without a header/separator row isn't recognised; deleting the header row is therefore blocked. |
| 128 | +- **Inline renderer** uses Logseq's experimental block renderer API. On older Logseq builds without `Experiments.registerBlockRenderer`, the plugin is a clean no-op (no table view, no commands beyond the slash insert). |
| 129 | + |
| 130 | +## Development |
| 131 | + |
| 132 | +```shell |
| 133 | +npm install # install deps |
| 134 | +npm start # browser dev mode (no Logseq host) |
| 135 | +npm run build # produce build/ for loading as unpacked plugin |
30 | 136 | ``` |
| 137 | + |
| 138 | +After editing source, run `npm run build` and reload the plugin in Logseq (**Settings → Plugins → ⋯ → Reload**). |
| 139 | + |
| 140 | +## License |
| 141 | + |
| 142 | +[MIT](./LICENSE) |
0 commit comments