تفصیلات ​

مختصر خلاصے اور متن کو ایک بلاک میں گروپ کریں۔ ٹول بار سے اسے بناتے وقت پہلے خلاصہ درج کریں، پھر اس کے نیچے مواد لکھنا جاری رکھیں۔

مثلث سے مقرر کردہ کھلی حالت دستاویز میں محفوظ ہوتی ہے اور شائع شدہ منظر کی ابتدائی حالت بنتی ہے۔ ترمیم کے دوران بھی مثلث پر کلک کر کے بلاک کھول یا بند کر سکتے ہیں۔

جدول کے خانے یا کسی دوسرے بلاک کے اندر صرف متعلقہ تہہ ہونے والا بلاک کھلتا اور بند ہوتا ہے۔ اگر کرسر یا انتخاب بند ہونے والے متن کے اندر ہو تو اسے باہر منتقل کیا جاتا ہے؛ دوسری جگہ کا انتخاب برقرار رہتا ہے۔

پَر
طے شدہ فونٹاونچائی
HTMLایڈیٹر لوڈ ہو رہا ہے…
JSONnabi-treeایڈیٹر لوڈ ہو رہا ہے…
تنصیب
npm install nabi-note
کوڈ
import {
  createLocale, createNabiWith, mountSurface, mountToolbar,
  mountContextToolbar, mountHints, watchSettle, quoteWing, detailsWing,
  codeWing, mountViewTools,
} from 'nabi-note'

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

// 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 })

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('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 وصف مصنف کی محفوظ کردہ ابتدائی کھلی حالت ہے۔ CSS اس حالت کی طرز بدل سکتی ہے، مگر حالت خود کو زبردستی نافذ نہ کرنا بہتر ہے۔