चित्र

चित्र का पता डालकर उसकी चौड़ाई और संरेखण बदलता है। मूल रूप से केवल http:, https: और उसी site के path अनुमत हैं; नया चित्र बीच में 60% चौड़ाई से शुरू होता है।

चौड़ाई केवल तय चरणों में सहेजी जाती है और संरेखण चित्र को समेटने वाले अनुच्छेद में सहेजा जाता है। blob: और data:image/... preview के लिए image wing और editor assembly, दोनों में local URL स्पष्ट रूप से अनुमत करें। SVG data URL अनुमत नहीं हैं।

पंख
डिफ़ॉल्ट फ़ॉन्टऊँचाई
HTMLसंपादक लोड हो रहा है…
JSONnabi-treeसंपादक लोड हो रहा है…
इंस्टॉल
npm install nabi-note
कोड
import {
  createNabiWith, mountSurface, mountToolbar, mountContextToolbar,
  mountHints, watchSettle, tableWings, imageWing, youtubeWing,
  mountViewTools,
} from 'nabi-note'

const selected = [
  ...tableWings,
  imageWing,
  youtubeWing,
]
const { nabi, registry } = createNabiWith(selected)

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

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

यह wing पता दस्तावेज़ में रखती है, file transfer नहीं करती। file server पर भेजने के लिए upload wing जोड़ें।

CSS शैलियाँ

चित्र को .nabi-content img से सजाएँ। सहेजी चौड़ाई और संरेखण कायम रखते हुए केवल सीमा या छाया जैसा रूप बदलें।

css
.article-body img {
  border-radius: 12px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
}

.dark .article-body img { box-shadow: 0 8px 24px rgb(0 0 0 / 35%); }

max-inline-size, block-size, चौड़ाई और संरेखण के मूल नियम न बदलें। चित्र का आकार दस्तावेज़ में सहेजा है; CSS में जबरन आकार तय करने पर लेखक की चौड़ाई से टकराव हो सकता है।