یوٹیوب

یوٹیوب ویڈیو کا URL یا ویڈیو ID لے کر اسے ایمبیڈ بلاک میں بدلیں۔ دستاویز میں مکمل URL کے بجائے صرف 11 حرفی ویڈیو ID اور چوڑائی محفوظ ہوتی ہے، اور نئی ویڈیو ابتدا میں 70٪ چوڑائی پر درمیان میں ہوتی ہے۔

چوڑائی مقررہ درجوں میں سے چنی جاتی ہے، اور سیدھ ویڈیو کو سمیٹنے والے پیراگراف پر محفوظ ہوتی ہے۔ ایڈیٹر میں پہلا کلک ویڈیو کو منتخب کرتا ہے؛ منتخب ہونے کے بعد دوبارہ کلک کرنے سے اسے چلایا جا سکتا ہے۔ پتہ بدلنے کے لیے ویڈیو حذف کر کے نئی شامل کریں۔

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

const selected = [
  codeWing,
  imageWing,
  youtubeWing,
]
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: 'ur' })

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

CSS طرزیں

ویڈیو کا بارڈر یا کونے بدلنے کے لیے .nabi-content iframe استعمال کریں۔ محفوظ شدہ چوڑائی یا سیدھ نہ بدلیں۔

css
.article-body iframe {
  border-radius: 14px;
  box-shadow: 0 10px 28px rgb(0 0 0 / 16%);
}

پیکیج ویڈیو کا درست حجم برقرار رکھنے کے لیے aspect-ratio، چوڑائی اور سیدھ کے مارجن استعمال کرتا ہے، اس لیے انہیں اووررائیڈ نہ کریں۔