NABI NOTE
নথি

বিস্তারিত

সংক্ষিপ্ত সারাংশ ও মূল অংশকে একটি ব্লকে রাখুন। টুলবার থেকে এটি তৈরি করলে আগে সারাংশ লেখেন, তারপর নিচে মূল লেখা চালিয়ে যান।

ত্রিভুজ দিয়ে ঠিক করা খোলা অবস্থা নথিতে সংরক্ষিত হয় এবং প্রকাশিত দৃশ্যের প্রাথমিক অবস্থা হয়। সম্পাদনার সময় বদলানোর সুবিধার জন্য মূল অংশ খোলা থাকে, তবে সংরক্ষিত অবস্থার মান বজায় থাকে।

ডানা
ডিফল্ট ফন্টউচ্চতা
HTMLসম্পাদক লোড হচ্ছে…
JSONnabi-treeসম্পাদক লোড হচ্ছে…
ইনস্টল
npm install nabi-note
কোড
import {
  createNabiWith, mountSurface, mountToolbar, mountContextToolbar,
  mountHints, watchSettle, quoteWing, detailsWing, codeWing,
  mountViewTools,
} from 'nabi-note'

const selected = [
  quoteWing,
  detailsWing,
  codeWing,
]
const { nabi, registry } = createNabiWith(selected)

// Bring your own highlighter (Prism, highlight.js, Shiki, …) — the wing stays as it is
// and only the attach is swapped (`makeCodeAttach` ships from the same door)
// { ...codeWing, attach: makeCodeAttach({ highlight: (source, lang) => [{ text: source }] }) }

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

const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale: 'bn' }
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('details').build()

CSS শৈলী

.nabi-content details দিয়ে বিস্তারিত ব্লক এবং .nabi-content details > summary দিয়ে শিরোনাম সাজান।

css
.article-body details {
  padding: .75rem 1rem;
  border: 1px solid var(--nabi-line);
  border-radius: var(--nabi-radius);
  background: var(--nabi-soft);
}

.article-body details > summary { cursor: pointer; font-weight: 700; }
.article-body details[open] > summary { margin-block-end: .75rem; }

open attribute হলো লেখকের সংরক্ষিত প্রাথমিক খোলা অবস্থা। CSS দিয়ে এই অবস্থা সাজানো যায়, কিন্তু অবস্থাটিকেই জোর করে বদলানো ভালো নয়।