글머리 목록
여러 항목을 순서 없이 나열하는 목록입니다. 빈 문단에서 - 뒤에 Space를 입력하거나 툴바에서 전환합니다. 선택한 문단도 한 번에 목록으로 묶을 수 있습니다.
목록 안에서는 Tab으로 한 단계 들여쓰고 Shift+Tab으로 내어씁니다. Enter는 다음 항목을 만들며, 비어 있는 항목에서 다시 Enter를 누르면 목록을 끝낼 수 있습니다. Shift+Enter는 항목을 나누지 않고 그 안에서 줄을 바꿉니다.
표 셀 안의 목록도 같은 입력 규칙을 따릅니다. 목록에서 Tab을 누르면 셀을 이동하는 대신 목록을 들여씁니다.
wing
기본 서체높이
HTML에디터를 불러오는 중…
JSON나비트리에디터를 불러오는 중…
설치
npm install nabi-note코드
import {
createLocale, createNabiWith, mountSurface, mountToolbar,
mountContextToolbar, mountHints, watchSettle, headingWing,
bulletListWing, orderedListWing, mountViewTools,
} from 'nabi-note'
const selected = [
headingWing,
bulletListWing,
orderedListWing,
]
const locale = createLocale('ko')
const { nabi, registry } = createNabiWith(selected, { locale })
const root = document.querySelector('.nabi')!
const content = document.querySelector('.nabi-content')!
// locale 이 글의 방향도 정한다 — 아랍어·우르두면 오른쪽에서 왼쪽으로 선다
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 })
// 미리보기·전체화면 두 단추 — 툴바 줄의 끝에 제 상자를 세워 앉는다
mountViewTools({ ...shared, root, container: document.querySelector('#toolbar')! })
// 값이 바뀔 때마다 — 여기에 당신의 코드를 건다
// nabi.onChange(() => user_callback(nabi.getHtml()))
// 언어 선택 이벤트에서 호출한다. 내용과 편집 이력은 유지된다.
// locale.setLocale('ko')ts
const selected = wings().use('ul').build()