제목
문단을 제목으로 바꾸고 단계도 정합니다. 툴바에서 제목을 켠 뒤 H1부터 H6까지 고르거나, 빈 문단에서 #부터 ###### 뒤에 Space를 입력합니다.
제목은 별도 블록 종류가 아니라 문단에 저장되는 속성입니다. 제목을 다시 누르면 일반 문단으로 돌아오므로, 본문 구조를 유지한 채 단계만 바꿀 수 있습니다.
wing
기본 서체높이
HTML에디터를 불러오는 중…
JSON나비트리에디터를 불러오는 중…
설치
npm install nabi-note코드
import {
createNabiWith, mountSurface, mountToolbar, mountContextToolbar,
mountHints, watchSettle, headingWing, bulletListWing, mountViewTools,
} from 'nabi-note'
const selected = [
headingWing,
bulletListWing,
]
const { nabi, registry } = createNabiWith(selected)
const root = document.querySelector('.nabi')!
const content = document.querySelector('.nabi-content')!
// locale 이 글의 방향도 정한다 — 아랍어·우르두면 오른쪽에서 왼쪽으로 선다
mountSurface({ nabi, registry, root: content, locale: 'ko' })
const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale: 'ko' }
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()))ts
const selected = wings().use('h').build()