任务列表 ​

带有完成状态的列表。在空段落中输入 [ ] 或 [x] 后按 Space,或从工具栏创建,然后点击复选框改变状态。

每一项的勾选状态会和文档一起保存。拆分项目时,勾选状态会跟随保留文字的那一项,而不是前面的空项目,因此拆分已完成任务时状态不会意外反转。

Enter 拆分项目,Shift+Enter 只在项目内换行。Tab 和 Shift+Tab 用于增加和减少缩进。表格单元格内遵循相同规则,也会保存勾选状态。

翅膀
默认字体高度
HTML正在加载编辑器…
JSONnabi-tree正在加载编辑器…
安装
npm install nabi-note
代码
import {
  createLocale, createNabiWith, mountSurface, mountToolbar,
  mountContextToolbar, mountHints, watchSettle, orderedListWing,
  taskListWing, tableWings, mountViewTools,
} from 'nabi-note'

const selected = [
  orderedListWing,
  taskListWing,
  ...tableWings,
]
const locale = createLocale('zh')
const { nabi, registry } = createNabiWith(selected, { locale })

const root = document.querySelector('.nabi')!
const content = document.querySelector('.nabi-content')!

// The locale also sets the direction — Arabic and Urdu run right to left
mountSurface({ nabi, registry, root: content, locale })

const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale }
const toolbar = mountToolbar({ ...shared, root: document.querySelector('#toolbar')! })
const context = mountContextToolbar({ ...shared, root: document.querySelector('#context')! })
mountHints({ toolbar, context, root, surface: content })
// The preview and fullscreen buttons — they stand their own box at the end of the row
mountViewTools({ ...shared, root, container: document.querySelector('#toolbar')! })

// on every change — hook up your own code here
// nabi.onChange(() => user_callback(nabi.getHtml()))

// Call from your language selector. Content and editing history stay intact.
// locale.setLocale('ko')
ts
const selected = wings().use('tl').build()