YouTube

YouTube video URL किंवा video ID स्वीकारून त्याचे embed block करा. document पूर्ण URL नव्हे तर फक्त 11-अक्षरी video ID आणि width साठवते, आणि नवा video 70% width वर मध्यभागी सुरू होतो.

width ठराविक steps मधून निवडली जाते आणि alignment video ला wrap करणाऱ्या paragraph वर साठवले जाते. editor मध्ये पहिला click video निवडतो; निवडल्यानंतर पुन्हा click केल्यास तो play होऊ शकतो. address बदलण्यासाठी video काढून नवा घाला.

विंग्ज
मूलभूत अक्षररूपअंतर
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: 'mr' })

const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale: 'mr' }
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 शैली

video ची border किंवा corners बदलण्यासाठी .nabi-content iframe वापरा. साठवलेली width किंवा alignment बदलू नका.

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

video चा आकार योग्य ठेवण्यासाठी package aspect-ratio, width आणि alignment margins वापरते, म्हणून ते override करू नका.