番号付きリスト

順序が重要な項目を番号付きリストにします。空の段落で 1. のように数字とピリオドを入力してから Space を押すか、選択した段落をツールバーから切り替えます。

表示される番号は項目の位置から計算されるため、項目を追加したりインデントしたりしても自動で続きます。入力した開始番号を保存して任意の番号から数える機能はありません。

ウィング
既定の書体高さ
HTMLエディタを読み込んでいます…
JSONnabi-treeエディタを読み込んでいます…
インストール
npm install nabi-note
コード
import {
  createNabiWith, mountSurface, mountToolbar, mountContextToolbar,
  mountHints, watchSettle, bulletListWing, orderedListWing,
  taskListWing, mountViewTools,
} from 'nabi-note'

const selected = [
  bulletListWing,
  orderedListWing,
  taskListWing,
]
const { nabi, registry } = createNabiWith(selected)

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: 'ja' })

const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale: 'ja' }
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()))
ts
const selected = wings().use('ol').build()