Görsel

Bir görsel URL'si ekleyin, genişliğini ve hizalamasını ayarlayın. Varsayılan olarak adresler http:, https: veya aynı site yollarıyla sınırlıdır; yeni görsel ortada %60 genişlikle başlar.

Genişlik yalnızca sabit adımlarla saklanır; hizalama görseli saran paragrafta tutulur. blob: ya da data:image/... önizlemelerini kullanmak için hem image wing'de hem editör kurulumunda yerel URL'lere açıkça izin verin. SVG data URL'lerine izin verilmez.

Kanatlar
Temel yazı tipiOfset
HTMLDüzenleyici yükleniyor…
JSONnabi-treeDüzenleyici yükleniyor…
Yükle
npm install nabi-note
Kod
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: 'tr' })

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

Bu wing belgeye bir adres ekler; dosya yüklemez. Dosyaları sunucuya göndermek için upload wing bağlayın.

CSS stilleri

Görselleri .nabi-content img ile biçimlendirin. Saklanan genişliği ve hizalamayı bozmadan yalnızca kenarlık veya gölge gibi görsel ayrıntıları değiştirin.

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, genişlik ve hizalama için varsayılan kuralları koruyun. Görsel boyutu belgede saklanır; CSS ile sabit genişliği zorlamak yazarın seçtiği genişlikle çakışabilir.